Given groups $N$ and $K$, if $K$ acts on $N$ by \begin{equation} K\xrightarrow{\theta}\operatorname{Aut_{Grp}}(N), \end{equation} then we can define a group $N\rtimes_{\theta}K$ whose elements are like in $N\times K$ but the multiplication is defined by \begin{equation} (n,k)(n',k')=(n\theta_{k}(n'),kk') \end{equation} where $\theta_k\in \operatorname{Aut_{Grp}}(N)$ is the image of $k$ under $\theta$.
This semidirect product is very useful in studying structures of finite groups, especially it solves the extension problem \begin{equation} 1\longrightarrow N\longrightarrow N\rtimes_{\theta} K\longrightarrow K\longrightarrow 1. \end{equation} But I am wondering whether this can be defined using universal properties? In the abelian case $N\rtimes K$ is just $N\times K$ so we have the universal property of products, but what about the nonabelian case?
Thanks!