We report refined crystal structures of the hexameric soluble inorganic pyrophosphatase from Escherichia coli (E-PPase) to R-factors of 18.3% and 17.1% at 2.2 and 2.3 Angstrom, respectively. Both structures contain two independent monomers in the asymmetric unit of an R32 cell, The difference between the structures is that the latter contains 1.5 Mg2+ ions per monomer. One metal ion binds to the ''tight'' metal-binding site identified by equilibrium dialysis studies, and is coordinated to Asp65, Asp70, and Asp102. The other metal ion, shared between two monomers at a hitherto unidentified metal-binding site in the dyad interface between trimers, is coordinated through water molecules to Asp26s and Asn24s from the two monomers. The hexamers with metal bound to them are more tightly associated than the ones without metal bound to them. Combined with our other mechanistic and structural data, the results suggest that, at high metal concentrations, E-PPase may bind at least 4.5 metals per monomer: two in the active site before binding substrate, two with substrate, and 0.5 in the dyad interface, Glu20 interacts via a water molecule with Asp70 and appears in the related yeast PPase structure (Heikinheimo, manuscript in preparation) to be involved in binding the second metal ion. Magnesium ion therefore stabilizes the hexamer form through both direct and indirect effects, The direct effect is by tighter association at the subunit interface; the indirect effect occurs because magnesium stabilizes the correct conformation of the loop between Glu20 and Ile32, a loop involved in trimer-trimer interactions. Our results thus provide a structural explanation for the solution studies that show that the E20D variant is partially hexameric and that the hexamer form can be stabilized by binding magnesium ion.