Precise timekeeping is critical to metrology, forming the basis by which standards of time, length, and fundamental constants are determined. Stable clocks are particularly valuable in spectroscopy because they define the ultimate frequency precision that can be reached. In quantum metrology, the qubit coherence time defines the clock stability, from which the spectral linewidth and frequency precision are determined. We demonstrate a quantum sensing protocol in which the spectral precision goes beyond the sensor coherence time and is limited by the stability of a classical clock. Using this technique, we observed a precision in frequency estimation scaling in time T as T–3/2 for classical oscillating fields. The narrow linewidth magnetometer based on single spins in diamond is used to sense nanoscale magnetic fields with an intrinsic frequency resolution of 607 microhertz, which is eight orders of magnitude narrower than the qubit coherence time.