Space-like separation of entangled quantum states is a central concept in fundamental investigations of quantum mechanics and in quantum communication applications. Optical approaches are ubiquitous in the distribution of entanglement because entangled photons are easy to generate and transmit. However, extending this direct distribution beyond a range of a few hundred kilometres to a worldwide network is prohibited by losses associated with scattering, diffraction and absorption during transmission. A proposal to overcome this range limitation is the quantum repeater protocol, which involves the distribution of entangled pairs of optical modes among many quantum memories stationed along the transmission channel. To be effective, the memories must store the quantum information encoded on the optical modes for times that are long compared to the direct optical transmission time of the channel. Here we measure a decoherence rate of 8 × 10-5 per second over 100 milliseconds, which is the time required for light transmission on a global scale. The measurements were performed on a ground-state hyperfine transition of europium ion dopants in yttrium orthosilicate (151Eu3+:Y2SiO5) using optically detected nuclear magnetic resonance techniques. The observed decoherence rate is at least an order of magnitude lower than that of any other system suitable for an optical quantum memory. Furthermore, by employing dynamic decoupling, a coherence time of 370 +/- 60 minutes was achieved at 2 kelvin. It has been almost universally assumed that light is the best long-distance carrier for quantum information. However, the coherence time observed here is long enough that nuclear spins travelling at 9 kilometres per hour in a crystal would have a lower decoherence with distance than light in an optical fibre. This enables some very early approaches to entanglement distribution to be revisited, in particular those in which the spins are transported rather than the light.