The substitution of the divalent cations Mg 2+ and Zn 2+ into the aluminophosphate (AlPO) framework of STA-2 has been studied using an "NMR crystallographic" approach, combining multinuclear solid-state NMR spectroscopy, X-ray diffraction and firstprinciples calculations. Although the AlPO framework itself is inherently neutral, the positive charge of the organocation template in an as-made material is usually balanced either by the coordination to the framework of anions from the synthesis solution, such as OH or F , and/or by the substitution of aliovalent cations. However, the exact position and distribution of the substituted cations can be difficult to determine, but can have a significant impact upon the catalytic properties a material exhibits once calcined. For as-made Mg substituted STA-2, the positive charge of the organocation template is balanced by the substitution of Mg 2+ for Al 3+ and, where required, by hydroxide anions coordinated to the framework. 27 Al MAS NMR spectra show that Al is present in both tetrahedral and five-fold coordination, with the latter dependent on the amount of substituted cations, and confirms the bridging nature of the hydroxyl groups, while high-resolution MQMAS spectra are able to show that Mg appears to preferentially substitute on the Al1 site. This conclusion is also supported by first-principles calculations.The calculations also show that 31 P chemical shifts depend not only on the topologicallydistinct site in the SAT framework, but also on the number of next-nearest-neighbour Mg species, and the exact nature of the coordinated hydroxyls (whether the P atom forms part of a six-membered ring, P(OAl)2OH, where OH bridges between two Al atoms). The calculations demonstrate a strong correlation between the 31 P isotropic chemical shift and the average bond angle. In contrast, for Zn substituted STA-2, both X-ray diffraction and NMR spectroscopy show less preference for substitution onto Al1 or Al2, with both appearing to be present, although that into Al1 appears slightly more favoured.