  Let $S$ be a $p$-subgroup of the $\K$-automorphism group $\aut(\cX)$ of an
algebraic curve $\cX$ of genus $\gg\ge 2$ and $p$-rank $\gamma$ defined over an
algebraically closed field $\mathbb{K}$ of characteristic $p\geq 3$.In this
paper we prove that if $|S|>2(\gg-1)$ then one of the following cases occurs.
\begin{itemize} \item[(i)] $\gamma=0$ and the extension $\K(\cX)/\K(\cX)^S$
completely ramifies at a unique place, and does not ramify elsewhere.
\item[(ii)] $\gamma>0$, $p=3$, $\cX$ is a general curve, $S$ attains the
Nakajima's upper bound $3(\gamma-1)$ and $\K(\cX)$ is an unramified Galois
extension of the function field of a general curve of genus $2$ with equation
$Y^2=cX^6+X^4+X^2+1$ where $c\in\K^*$. \end{itemize} Case (i) was investigated
by Stichtenoth, Lehr, Matignon, and Rocher.
