The discovery of superconductivity at 200 kelvin in the hydrogen sulfide system at high pressures1 demonstrated the potential of hydrogen-rich materials as high-temperature superconductors. Recent theoretical predictions of rare-earth hydrides with hydrogen cages2,3 and the subsequent synthesis of LaH10 with a superconducting critical temperature (Tc) of 250 kelvin4,5 have placed these materials on the verge of achieving the long-standing goal of room-temperature superconductivity. Electrical and X-ray diffraction measurements have revealed a weakly pressure-dependent Tc for LaH10 between 137 and 218 gigapascals in a structure that has a face-centred cubic arrangement of lanthanum atoms5. Here we show that quantum atomic fluctuations stabilize a highly symmetrical [Formula: see text] crystal structure over this pressure range. The structure is consistent with experimental findings and has a very large electron-phonon coupling constant of 3.5. Although ab initio classical calculations predict that this [Formula: see text] structure undergoes distortion at pressures below 230 gigapascals2,3, yielding a complex energy landscape, the inclusion of quantum effects suggests that it is the true ground-state structure. The agreement between the calculated and experimental Tc values further indicates that this phase is responsible for the superconductivity observed at 250 kelvin. The relevance of quantum fluctuations calls into question many of the crystal structure predictions that have been made for hydrides within a classical approach and that currently guide the experimental quest for room-temperature superconductivity6-8. Furthermore, we find that quantum effects are crucial for the stabilization of solids with high electron-phonon coupling constants that could otherwise be destabilized by the large electron-phonon interaction9, thus reducing the pressures required for their synthesis.