Doubly charged positive ions (dications) are an important component of planetary ionospheres because of the large energy required for their formation. Observations of these ions are exceptionally difficult due to their low abundances; until now, only atomic dications have been detected. The Neutral Gas and Ion Mass Spectrometer (NGIMS) measurements made on board the recent Mars Atmosphere and Volatile Evolution mission provide the first opportunity for decisive detection of molecular dications, CO2++ in this case, in a planetary upper atmosphere. The NGIMS data reveal a dayside averaged CO2++ distribution declining steadily from 5.6 cm−3 at 160 km to below 1 cm−3 above 200 km. The dominant CO2++ production mechanisms are double photoionization of CO2 below 190 km and single photoionization of CO2+ at higher altitudes; CO2++ destruction is dominated by natural dissociation, but reactions with atmospheric CO2 and O become important below 160 km. Simplified photochemical model calculations are carried out and reasonably reproduce the data at low altitudes within a factor of 2 but underestimate the data at high altitudes by a factor of 4. Finally, we report a much stronger solar control of the CO2++ density than of the CO2+ density .