This paper presents the performance of the ATLAS muon reconstruction during the LHC run with pp collisions at root s = 7-8 TeV in 2011-2012, focusing mainly on data collected in 2012. Measurements of the reconstruction efficiency and of the momentum scale and resolution, based on large reference samples of J/psi -> mu mu, Z -> mu mu and gamma -> mu mu decays, are presented and compared to Monte Carlo simulations. Corrections to the simulation, to be used in physics analysis, are provided. Over most of the covered phase space (muon |eta| < 2.7 and 5 less than or similar to p(T) less than or similar to 100 GeV) the efficiency is above 99% and is measured with per-mille precision. The momentum resolution ranges from 1.7% at central rapidity and for transverse momentum p(T) similar or equal to 10 GeV, to 4% at large rapidity and p(T) similar or equal to 100 GeV. The momentum scale is known with an uncertainty of 0.05% to 0.2% depending on rapidity. A method for the recovery of final state radiation from the muons is also presented.