Algebra, by T. W. Hungerford, page 127. Theorem 2.15. ''If $P$ is an ideal in a ring $R$ such that $P \neq R$ and for all $a, b \in R$ \begin{equation} \label{1} ab \in P \Rightarrow a \in P \mbox{ or } b \in P, \hspace{2cm} (1) \end{equation} then, $P$ is prime. Conversely if $P$ is prime and $R$ is commutative, then $P$ satisfies condition $(1)$'' Remark: Commutativity is necessary for the converse.
If I understood it correctly, there should exist a ring $R$ which is not commutative, with a prime ideal $P$ with the following property: $ab \in P$ and $a \notin P$ and $b \notin P$.
This is the example I had asked for in the previous version of my question.
PS: Definition of prime ideal, according to Hungerford:
''An ideal $P$ in a ring $R$ is said to be prime if $P \neq R$ and, for any ideals $A, B$ in $R$, $$AB \subset P \Rightarrow A \subset P \mbox{ or } B \subset P. $$
Yes, just look at the zero ideal of $M_2(F)$ for a field $F$.
It’s prime (because it’s maximal) but there are clearly zero divisors.
To distinguish the two concepts in noncommutative rings, we usually call an ideal satisfying the commutative definition of prime a “completely prime ideal.”