Quantum entanglement is among the most fascinating aspects of quantum theory1. Entangled optical photons are now widely used for fundamental tests of quantum mechanics2 and applications such as quantum cryptography1. Several recent experiments demonstrated entanglement of optical photons with trapped ions3, atoms4, 5 and atomic ensembles6, 7, 8, which are then used to connect remote long-term memory nodes in distributed quantum networks9, 10, 11. Here we realize quantum entanglement between the polarization of a single optical photon and a solid-state qubit associated with the single electronic spin of a nitrogen vacancy centre in diamond. Our experimental entanglement verification uses the quantum eraser technique5, 12, and demonstrates that a high degree of control over interactions between a solid-state qubit and the quantum light field can be achieved. The reported entanglement source can be used in studies of fundamental quantum phenomena and provides a key building block for the solid-state realization of quantum optical networks13, 14.