The ATLAS detector at the Large Hadron Collider has collected several hundred million cosmic ray events during 2008 and 2009. These data were used to commission the Muon Spectrometer and to study the performance of the trigger and tracking chambers, their alignment, the detector control system, the data acquisition and the analysis programs. We present the performance in the relevant parameters that determine the quality of the muon measurement. We discuss the single element efficiency, resolution and noise rates, the calibration method of the detector response and of the alignment system, the track reconstruction efficiency and the momentum measurement. The results show that the detector is close to the design performance and that the Muon Spectrometer is ready to detect muons produced in high energy proton-proton collisions.