The Escherichia coli periplasmic glucose-1-phosphatase is a member of the histidine acid phosphatase family and acts primarily as a glucose scavenger. Previous substrate profiling studies have demonstrated some of the intriguing properties of the enzyme, including its unique and highly selective inositol phosphatase activity. The enzyme is also potentially involved in pathogenic inositol phosphate signal transduction pathways via type III secretion into the host cell. We have determined the crystal structure of E. coli glucose-1-phosphatase in an effort to unveil the structural mechanism underlying such unique substrate specificity. The structure was determined by the method of multiwavelength anomalous dispersion using a tungstate derivative together with the H18A inactive mutant complex structure with glucose 1-phosphate at 2.4-A resolution. In the active site of glucose-1-phosphatase, there are two unique gating residues, Glu-196 and Leu-24, in addition to the conserved features of histidine acid phosphatases. Together they create steric and electrostatic constraints responsible for the unique selectivity of the enzyme toward phytate and glucose-1-phosphate as well as its unusually high pH optimum for the latter. Based on the structural characterization, we were able to derive simple structural principles that not only precisely explains the substrate specificity of glucose-1-phosphatase and the hydrolysis products of various inositol phosphate substrates but also rationalizes similar general characteristics across the histidine acid phosphatase family.