25Mg, 43Ca and 31P NMR have been used to study the binding of Mg2+ and Ca2+ ions to β-casein A1. The concentration dependence of the line width of the 25Mg NMR signal shows that β-casein contains at least two different types of binding sites for Mg2+ ions, one with strongly bound, slowly exchanging ions and one with more weakly bound ions which undergo fast exchange. The strong Mg2+ binding site has an unexpectedly high binding constant, Kbstrong 104 M–1, which has not been reported earlier. Mg2+ and Ca2+ compete for the Ca2+ binding sites of β-casein, while Na+ does not compete for these binding sites under physiological conditions. The dependence of the 43Ca NMR chemical shifts on total concentration of Mg2+ and Ca2+, in the presence of β-casein, could be equally well fitted with a model assuming up to five identical and independent sites as with a model assuming five or more sites with negative cooperativity. The proton dissociation constant, pka, for the strongest Ca2+ binding site was found to be 7·1.