This paper presents a search for the pair production of top squarks in events with a single isolated electron or muon, jets, large missing transverse momentum, and large transverse mass. The data sample corresponds to an integrated luminosity of 19.5 fb−1 of pp collisions collected in 2012 by the CMS experiment at the LHC at a center-of-mass energy of s√=8 TeV . No significant excess in data is observed above the expectation from standard model processes. The results are interpreted in the context of supersymmetric models with pair production of top squarks that decay either to a top quark and a neutralino or to a bottom quark and a chargino. For small mass values of the lightest supersymmetric particle, top-squark mass values up to around 650 GeV are excluded.