This group is the Heisenberg group over $\mathbb{F}_p$ of order $p^3$. Now every non-abelian group of order $p^3$ with a prime $p>2$ is a semidirect product. To see this, we prove it for the case that we have at least two different elements $a,b$ of order $p$. This is the case for the Heisenberg group, for which all non-trivial elements have order $p$. Then let $N=\langle a,b\rangle$
be the product of the cyclic groups $\langle a\rangle$ and $\langle b\rangle$. Let $Q=\langle c \rangle$
with another element $c$ of order $p$. Define $\theta\colon Q\rightarrow {\rm Aut}(N)$ to be the homomorphism such that
$$
\theta(c^i)(a)=ab^i,\; \theta(c^i)(b)=b.
$$
The group $G:=N\ltimes_{\theta}Q$ is of order $p^3$, with generators $a,b,c$ and defining relations
$$
a^p=b^p=c^p=1,\; ab=cac^{-1},\; [b,a]=[b,c]=1,
$$
where $[g,h]:=g^{-1}h^{-1}gh$ denotes the commutator of two elements.
This group is isomorphic to the Heisenberg group over $\mathbb{Z}/(p)$.
So we have
$$
G\cong N\ltimes_{\theta}Q\cong (\mathbb{Z}/(p)\times \mathbb{Z}/(p)) \ltimes \mathbb{Z}/(p).
$$
When $p=2$, then $G\cong D_4$, in which case the claim is also true, as we know from the dihedral group $D_4$.