Trimagnesium phosphate

Trimagnesium phosphate describes inorganic compounds with formula Mg3(PO4)2.xH2O. They are magnesium acid salts of phosphoric acid, with varying amounts of water of crystallization: x = 0, 5, 8, 22.

The octahydrate forms upon reaction of stoichiometric quantities of monomagnesium phosphate (tetrahydrate) with magnesium hydroxide.
 * Mg(H2PO4)2•4H2O +  2 Mg(OH)2   →   Mg3(PO4)2•8H2O

The octahydrate is found in nature as the mineral bobierrite.

The anhydrous compound is obtained by heating the hydrates to 400 °C. It is isostructural with cobalt(II) phosphate. The metal ions occupy both octahedral (six-coordinate) and pentacoordinate sites in a 1:2 ratio.

Safety
Magnesium phosphate tribasic is listed on the FDA's generally recognized as safe, or GRAS, list of substances.