Long-distance quantum communication requires photons and quantum nodes that comprise qubits for interaction with light and good memory capabilities, as well as processing qubits for the storage and manipulation of photons. Owing to the unavoidable photon losses, robust quantum communication over lossy transmission channels requires quantum repeater networks1,2. A necessary and highly demanding prerequisite for these networks is the existence of quantum memories with long coherence times to reliably store the incident photon states. Here we demonstrate the high-fidelity (∼98%) coherent transfer of a photon polarization state to a single solid-state nuclear spin that has a coherence time of over 10 s. The storage process is achieved by coherently transferring the polarization state of a photon to an entangled electron– nuclear spin state of a nitrogen–vacancy centre in diamond. The nuclear spin-based optical quantum memory demonstrated here paves the way towards an absorption-based quantum repeater network.