This paper presents measurements from the ATLAS experiment of the forwardbackward asymmetry in the reaction pp → Z/γ* → l+l−, with l being electrons or muons, and the extraction of the effective weak mixing angle. The results are based on the full set of data collected in 2011 in pp collisions at the LHC at √s = 7TeV, corresponding to an integrated luminosity of 4.8 fb−1. The measured asymmetry values are found to be in agreement with the corresponding Standard Model predictions. The combination of the muon and electron channels yields a value of the effective weak mixing angle of sin2θlept eff = 0.2308±0.0005(stat.)±0.0006(syst.)±0.0009(PDF), where the first uncertainty corresponds to data statistics, the second to systematic effects and the third to knowledge of the parton density functions. This result agrees with the current world average from the Particle Data Group fit.