In the mitochondrial matrix, there are insoluble, osmotically inactive complexes that maintain a constant pH and calcium concentration. In the present paper, we examine the properties of insoluble calcium and magnesium salts, such as phosphates, carbonates and polyphosphates, which might play this role. We find that non-stoichiometric, magnesium-rich carbonated apatite, with very low crystallinity, precipitates in the matrix under physiological conditions. Precipitated salt acts as pH buffer, and, hence, can contribute in maintaining ATP production in ischemic conditions, which delays irreversible damage to heart and brain cells after stroke.