  A longstanding conjecture asserts that every non-abelian finite $p$-group $G$
admits a non-inner automorphism of order $p$. The conjecture is valid for
finite $p$-groups of class 2. Here, we prove every finite non-abelian $p$-group
$G$ of class 3 with $p>2$ has a noninner automorphism of order $p$ leaving
$\Phi(G)$ elementwise fixed. We also prove that if $G$ is a finite 2-group of
class 3 which cannot be generated by 4 elements, then $G$ has a non-inner
automorphism of order 2 leaving $\Phi(G)$ elementwise fixed. We also prove that
the latter conclusion holds for finite 2-groups $G$ of class 3 such that the
center of $G$ is not cyclic and the minimal number of generators of $G$ is 2 or
4 and it holds whenever the center of $G$ is {\em not} 2-generated and the
minimal number of generators of $G$ is 3. Some results are also proved for the
existence of non-inner automorphisms of order $p$ for a finite $p$-group $G$
under conditions in terms of the minimal number of generators of the center
factor of $G$ and a certain function of the rank of $G$.
