We develop a gauge theory for diffusive and precessional spin dynamics in two-dimensional electron gas with disorder. Our approach reveals a direct connections between the absence of the equilibrium spin current and strong anisotropy in the spin relaxation: both effects arise if the spinorbit coupling is reduced to a pure gauge SU (2) field. In this case, by a gauge transformation in the form of a local SU (2) rotation in the spin subspace the spin-orbit coupling can be removed. The resulting spin dynamics is exactly described in terms of two kinetic coefficients: the spin diffusion and electron mobility. After the inverse transformation, full diffusive and precessional spin density dynamics, including the anisotropic spin relaxation, formation of stable spin structures, and spin precession induced by a macroscopic current, is restored. Explicit solutions of the spin evolution equations are found for the initially uniform spin density and for stable nonuniform structures.Our analysis demonstrates a universal relation between the spin relaxation rate and spin diffusion coefficient.