Let G be a finite p-group which has exactly one maximal subgroup H such that its derived subgroup H' is noncyclic. Then we must have p = 2, G′ is abelian of rank 2, |G′ : H′| = 2 and (G) = 2 or 3 (Theorems 6 and 8). This solves the problem No. 2248 stated by Berkovich in [ Groups of Prime Power Order, Vol. 3 (Walter de Gruyter, Berlin, 2011)].