A measurement of the cross section for top quark-antiquark (t (t) over bar) pairs produced in association with a photon in proton-proton collisions at root s = 8TeV is presented. The analysis uses data collected with the CMS detector at the LHC, corresponding to an integrated luminosity of 19.7 fb(1). The signal is de fined as the production of a t (t) over bar pair in association with a photon having a transverse energy larger than 25 GeV and an absolute pseudorapidity smaller than 1.44. The measurement is performed in the fiducial phase space corresponding to the semileptonic decay chain of the t (t) over bar pair, and the cross section is measured relative to the inclusive t (t) over bar pair production cross section. The fiducial cross section for associated t (t) over bar pair and photon production is found to be 127 +/- 27 (stat + syst) fb per semileptonic final state. The measured value is in agreement with the theoretical prediction.