Given a 3 by 3 matrix $M$ I would like to find the rotation matrix $R$ minimizing the Frobenius norm:

\begin{equation} \|R-M\|_F \end{equation}

Is there a closed form solution for $R$, or is it possible to express $R$ as the solution to a linear system? I would like to avoid gradient descent if possible.