Maximal ideals in a PID

Suppose R is a PID (principal ideal domain). Prove that an ideal I⊂R is maximal if and only if I=⟨p⟩ for a prime p∈R. (By definition, an element p is prime if whenever p∣ab then p∣a or p∣b. If you use the fact that prime implies irreducible, you have to prove it.)