The distal histidine residue, His64(E7), and the proximal histidine residue, His93(F8), in myoglobin (Mb) are important for the function of the protein. For example, the increase in the association rate constant for CO binding at low pH has been suggested to be caused by the protonation of these histidine residues. In order to investigate the influence of protonation on the structure of myoglobin, we determined the crystal structures of sperm whale myoglobin to 2.0 A or better in different states of ligation (MbCO, deoxyMb and metMb) at pH values of 4, 5 and 6. The most dramatic change found at low pH is that His64 swings out of the distal pocket in the MbCO structure at pH 4, opening a direct channel from the solvent to the iron atom. This rotation seems to be facilitated by conformational changes in the CD corner. The benzyl side-chain of Phe46(CD4), which has been suggested to be a critical residue in controlling the rotation of His64, moves away from His64 at pH 4 in the deoxyMb structure, allowing more free rotation of His64. Arg45(CD3) is also important for the dynamics of myoglobin, since it influences the pK(a) of His64 and forms a hydrogen bond lattice that hinders the rotation of His64 at neutral pH. This hydrogen-bond lattice disappears at low pH. Although His64 rotates out of the distal pocket in the MbCO structure at pH 4, leaving more space for the CO ligand, the Fe-C-O angle refines to about 130 degrees, the same as those at pH 5 and 6. In the MbCO structure at pH 4, significant conformational changes appear in the EF corner. The peptide plane between Lys79(EF2) and Gly80(EF3) flips about 150 degrees. The occupancy of this conformation in the MbCO structures increases with decreases in pH. On the proximal side of the heme, the bond between the heme iron atom and N(epsilon) of His93 remains intact under the experimental conditions in the MbCO and deoxyMb structures, but appears elongated in the metMb structure at pH 4, representing either a weakened bond or the breakage of the bond in some fraction of the molecules in the crystal.