In this paper we prove that every nonabelian finite 2-group with a cyclic commutator subgroup has a noninner automorphism of order two fixing either Φ(G) or Z(G) elementwise. This, together with a result of Peter Schmid on regular p-groups, extends our result to the class of nonabelian finite p-groups with a cyclic commutator subgroup.