Dental enamel, a hierarchical material composed primarily of hydroxylapatite nanowires, is susceptible to degradation by plaque biofilm-derived acids. The solubility of enamel strongly depends on the presence of Mg2+, F-, and CO32-. However, determining the distribution of these minor ions is challenging. We show—using atom probe tomography, x-ray absorption spectroscopy, and correlative techniques—that in unpigmented rodent enamel, Mg2+ is predominantly present at grain boundaries as an intergranular phase of Mg-substituted amorphous calcium phosphate (Mg-ACP). In the pigmented enamel, a mixture of ferrihydrite and amorphous iron-calcium phosphate replaces the more soluble Mg-ACP, rendering it both harder and more resistant to acid attack. These results demonstrate the presence of enduring amorphous phases with a dramatic influence on the physical and chemical properties of the mature mineralized tissue.