The invariance of the standard model (SM) under the CPT transformation predicts equality of particle and antiparticle masses. This prediction is tested by measuring the mass difference between the top quark and antiquark (Delta m(t) = m(t) - m((t) over bar)) that are produced in pp collisions at a center-of-mass energy of 8 TeV, using events with a muon or an electron and at least four jets in the final state. The analysis is based on data corresponding to an integrated luminosity of 19.6 fb(-1) collected by the CMS experiment at the LHC, and yields a value of Delta m(t) = 0.15 0.19 (stat) +/- 0.09(syst) GeV, which is consistent with the SM expectation. This result is significantly more precise than previously reported measurements. (C) 2017 The Author(s). Published by Elsevier B.V.