The radiative properties of emitters are inherently linked to their surrounding environment1. Placing an electromagnetic resonator around emitters can enhance spontaneous emission, as shown by Purcell in the 1940s2. This approach is now routinely used in quantum computing and communication to channel photons emitted by atoms into well-defined modes and control atom–photon interactions3–9. For solid-state emitters, such as colour centres, the host lattice introduces an acoustic environment, allowing excited atoms to relax by emitting phonons10,11. Here we observe the acoustic Purcell effect by constructing a specially engineered, microwave-frequency nanomechanical resonator around a colour-centre spin qubit in diamond. Using a co-localized optical mode of the structure that strongly couples to the excited state of the colour centre, we perform single-photon-level laser spectroscopy at millikelvin temperatures and observe a 10-fold faster spin relaxation when the spin qubit is tuned into resonance with a 12 GHz acoustic mode. Moreover, we use the colour centre as an atomic-scale probe to measure the broadband phonon spectrum of the nanostructure up to 28 GHz. Our work establishes a new regime of control for quantum defects in solids and paves the way for interconnects between atomic-scale quantum memories12 and qubits encoded in acoustic and superconducting devices13.