Principal Ideal of Principal Ideal Domain is of Irreducible Element iff Maximal

Theorem
Let $\struct {D, +, \circ}$ be a principal ideal domain.

Let $\ideal p$ be the principal ideal of $D$ generated by $p$.

Then $p$ is irreducible $\ideal p$ is a maximal ideal of $D$.