Quantum entanglement is among the most fascinating aspects of quantum theory. Entangled optical photons are now widely used for fundamental tests of quantum mechanics and applications such as quantum cryptography. Several recent experiments demonstrated entanglement of optical photons with trapped ions, atoms and atomic ensembles, which are then used to connect remote long-term memory nodes in distributed quantum networks. 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 technique, 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 networks.