MgCl2 crystallizes in the cadmium chloride motif, which features octahedral Mg centers. Several hydrates are known with the formula MgCl2(H2O)"x", and each loses water at higher temperatures: "x" = 12 (−16.4 °C), 8 (−3.4 °C), 6 (116.7 °C), 4 (181 °C), 2 (about 300 °C). In the hexahydrate, the Mg2+ is also octahedral, but is coordinated to six water ligands. The thermal dehydration of the hydrates MgCl2(H2O)x ("x" = 6, 12) does not occur straightforwardly. Anhydrous MgCl2 is produced industrially by heating the chloride salt of hexammine complex [Mg(NH3)6]2+.