Se two my comments above containing solution of the problem. I repeat: A nonabelian $p$-group $G$ has the center of index $p^2$ if and only if $G=S\text{Z}(G)$, where $S\le G$ is minimal nonabelian.
yakov
- 115
- 4