The cross section of a top-quark pair produced in association with a photon is measured in proton-proton collisions at a centre-of-mass energy of s=8 TeV with 20.2 fb−1 of data collected by the ATLAS detector at the Large Hadron Collider in 2012. The measurement is performed by selecting events that contain a photon with transverse momentum pT > 15 GeV, an isolated lepton with large transverse momentum, large missing transverse momentum, and at least four jets, where at least one is identified as originating from a b-quark. The production cross section is measured in a fiducial region close to the selection requirements. It is found to be 139 ± 7 (stat.) ± 17 (syst.) fb, in good agreement with the theoretical prediction at next-to-leading order of 151 ± 24 fb. In addition, differential cross sections in the fiducial region are measured as a function of the transverse momentum and pseudorapidity of the photon.[Figure not available: see fulltext.].