Let R be a commutative ring. If P is a maximal ideal of R whose a power is finitely generated then we prove that P is finitely generated if R is either locally coherent or arithmetical or a polynomial ring over a ring of global dimension $le$ 2. And if P is a prime ideal of R whose a power is finitely generated then we show that P is finitely generated if R is either a reduced coherent ring or a polynomial ring over a reduced arithmetical ring. These results extend a theorem of Roitman, published in 2001, on prime ideals of coherent integral domains.