  Random motion of spins is usually detrimental in magnetic resonance
experiments. The spin diffusion in non-uniform magnetic fields causes
broadening of the resonance and limits the sensitivity and the spectral
resolution in applications like magnetic resonance spectroscopy. Here, by
observation of the parity-time ($PT$) phase transition of diffusive spins in
gradient magnetic fields, we show that the spatial degrees of freedom of atoms
could become a resource, rather than harmfulness, for high-precision
measurement of weak signals. In the normal phase with zero or low gradient
fields, the diffusion results in dissipation of spin precession. However, by
increasing the field gradient, the spin system undergoes a $PT$ transition, and
enters the $PT$ symmetry broken phase. In this novel phase, the spin precession
frequency splits due to spatial localization of the eigenmodes. We demonstrate
that, using these spatial-motion-induced split frequencies, the spin system can
serve as a stable magnetometer, whose output is insensitive to the inevitable
long-term drift of control parameters. This opens a door to detect extremely
weak signals in imperfectly controlled environment.
