Parton energy loss in the quark–gluon plasma (QGP) is studied with a measurement of photon-tagged jet production in 1.7 nb−1 of Pb+Pb data and 260 pb−1 of pp data, both at sNN=5.02 TeV, with the ATLAS detector. The process pp →γ+jet+X and its analogue in Pb+Pb collisions is measured in events containing an isolated photon with transverse momentum (pT) above 50 GeV and reported as a function of jet pT. This selection results in a sample of jets with a steeply falling pT distribution that are mostly initiated by the showering of quarks. The pp and Pb+Pb measurements are used to report the nuclear modification factor, RAA, and the fractional energy loss, Sloss, for photon-tagged jets. In addition, the results are compared with the analogous ones for inclusive jets, which have a significantly smaller quark-initiated fraction. The RAA and Sloss values are found to be significantly different between those for photon-tagged jets and inclusive jets, demonstrating that energy loss in the QGP is sensitive to the colour-charge of the initiating parton. The results are also compared with a variety of theoretical models of colour-charge-dependent energy loss.