The part of the Compact Reconnaissance Imaging Spectrometer (CRISM) for Mars investigation conducted during the Mars Reconnaissance Orbiter's (MRO's) primary science phase was a comprehensive investigation of past aqueous environments, structure of the planet's crust, past climate, and current meteorology. The measurements to implement this investigation include over 9500 targeted observations of surface features taken at spatial resolutions of better than 40 m/pixel, monitoring of seasonal variations in atmospheric aerosols and trace gases, and acquisition of a 200 m/pixel map covering over 55% of Mars in 72 selected wavelengths under conditions of relatively low atmospheric opacity. Key results from these data include recognition of a diversity of aqueous mineral-containing deposits, discovery of a widespread distribution of phyllosilicates in early to middle Noachian units, the first definitive detection of carbonates in bedrock, new constraints on the sequence of events that formed Hesperian-aged, sulfate-rich layered deposits, characterization of seasonal polar processes, and monitoring of the 2007 global dust event. Here we describe CRISM's science investigations during the Primary Science Phase, the data sets that were collected and their calibration and uncertainties, and how they have been processed and made available to the scientific community. We also describe the ongoing investigation during MRO's extended science phase.