The three-dimensional crystal structure of the bacterial chemotaxis protein CheY with the essential Mg2+ cation bound to the active site reveals large conformational changes caused by the metal binding. Displacements of up to 10 A are observed in several residues at the N terminus of alpha-helix 4 and in the preceding loop. One turn of this helix unwinds, and an Asn residue that was located inside the helix becomes the new N-cap. This supports the important role that N or C-cap residues play in alpha-helix stability. In addition the preceding beta-strand becomes elongated and a new beta-turn appears. The final effect is a significant modification of the surface relief of the protein in a region previously indicated, by genetic analysis, to be essential for CheY function. It is suggested that binding of a divalent cation to CheY could play a significant part in CheY activation and consequently in signal transduction in prokaryotes.