The Salmonella typhimurium class B nonspecific acid phosphatase (AphA protein) belongs to the L2-haloacid dehalogenase superfamily. The conserved Lys-154 interacts with substrate phosphate, nucleophile Asp-46, and Asp-173 in the wild-type AphA protein. Asp-173 also interacts with Mg(II) water ligand and with main-chain amide of loop-4. We report here the mutational analysis of Lys-154 and Asp-173, the crystal structures of the K154N and K154R mutants, and the results of electrostatic potential calculations. The K154N, K154R and D173N mutants display significant reduction in the phosphatase activity. Lys-154 may not be responsible for a juxtaposition of the substrate phosphate and the aspartyl nucleophile, but has an hitherto unknown functional role of rendering the substrate phosphorous atom electron deficient. Nearly 10,000-fold increase in the K(d) value for dissociation of the cofactor Mg(II) observed for the D173N mutant correlates well with theoretically estimated change in the binding free energy of Mg(II).