Magnesium in the active site of Escherichia coli alkaline phosphatase is important for both structural stabilization and catalysis.