We experimentally demonstrate a simple and robust protocol for the detection of weak radiofrequency magnetic fields using a single electron spin in diamond. Our method relies on spin locking, where the Rabi frequency of the spin is adjusted to match the MHz signal frequency. In a proof-of-principle experiment we detect a 7.5 MHz magnetic probe field of ∼ 40 nT amplitude with < 10 kHz spectral resolution. Rotating-frame magnetometry may provide a direct and sensitive route to high-resolution spectroscopy of nanoscale nuclear spin signals. Sensitive detection of weak external fields by a quantum two-level system is most commonly achieved by phase detection: In Ramsey interferometry, a quantum system is prepared in a superposition 1 √ 2 (|0 + |1 ) of states |0 and |1 , and then left to freely evolve during time τ . During evolution, state |1 will gain a phase advance ∆φ = τ ∆E/ over |0 (where ∆E is the energy separation between |0 and |1 ) that is manifest as a coherent oscillation between 1 √ 2 (|0 ± |1 ) states. These oscillations can be detected either directly or by backprojection onto |0 and |1 . For spin systems, which are considered here, the energy splitting sensitively depends on magnetic field B through the Zeeman effect ∆E = γB (where γ is the gyromagnetic ratio), allowing very small changes in B to be measured for spins with long coherence times τ .In its most basic variety, phase detection measures DC or low frequency (∼ kHz) AC fields that fluctuate slower than τ ; in other words, the free evolution process effectively acts as a low-pass filter with bandwidth ∝ τ −1 . Spin echo and multi-pulse decoupling sequences have been introduced to shift the detection window to higher frequencies while maintaining the narrow filter profile [8,9]. Going to higher frequencies is advantageous for two reasons: Firstly, coherence times generally increase, allowing for longer evolution times and better sensitivities. Additionally, spectral selectivity can be drastically improved. While multi-pulse decoupling sequences work well for capturing 1 MHz signals [8], extending this range to the tens or hundreds of MHz -an attractive frequency range for nuclear spin detection -is impractical due to the many fast pulses required for spin manipulation. Moreover, the response function of multi-pulse sequences has multiple spectral windows that complicate interpretation of complex signals.Presented here is a simple and robust method to directly detect 1 MHz magnetic signals with high sensitivity and spectral selectivity. Our approach relies on spin locking [10][11][12] and is illustrated in Fig. 1: In a spin-lock experiment, a resonant microwave field is applied in-phase with the coherent Larmor precession of the spin. In the picture of a reference frame rotating at the Larmor frequency ω 0 = ∆E/ (rotating frame), the microwave field appears as a constant field parallel to the spin's orientation. In this frame of reference, the spin is quantized along the microwave field axis with an energy separation of ω 1 = γB mw 1 between sta...