# $R$ is a unique factorization domain $\iff$ every prime minimal over a principal ideal is also principal

I'm trying to show that a ring $R$ is a unique factorization domain $\iff$ every prime minimal over a principal ideal is also principal.

I think the idea is to use the principal ideal theorem of Krull, but I don't know how to connect principal ideal properties with unique factorization domain properties. I know that "principal ideal domain $\implies$ unique factorization domain", which helps me if I prove $R$ is principal from the second statement, but that is as far as I can go right now.

PS: assume $R$ is a commutative ring with unity.

Thanks.

"$\Rightarrow$" If $\mathfrak p$ is minimal over $(a)$, then $\mathfrak p$ contains a prime element $p$ which appears in the decomposition of $a$ into primes. It follows that $\mathfrak p=(p)$.
"$\Leftarrow$" (I suppose that $R$ is an integral domain.) Use the Kaplansky's Theorem for UFDs: a domain is a UFD iff every nonzero prime ideal contains a nonzero prime. Let $\mathfrak q$ be a non-zero prime ideal, and $a\in\mathfrak q$, $a\ne 0$. Then there is $\mathfrak p$ a prime ideal contained in $\mathfrak q$ which is minimal over $(a)$. Since $\mathfrak p$ is principal, then it is generated by a prime element, so $\mathfrak q$ contains a nonzero prime.