Magnesium ions play important roles in the structure and function of nucleic acids. Whereas the tertiary folding of RNA often requires magnesium ions binding to tight places where phosphates are clustered, the molecular basis of the interactions of magnesium ions with RNA helical regions is less well understood. We have refined the crystal structures of four decamer oligonucleotides, d(ACCGGCCGGT), r(GCG)d(TATACGC), r(GC)d(GTATACGC) and r(G)d(GCGTATACGC) with bound hexahydrated magnesium ions at high resolution. The structures reveal that A-form nucleic acid has characteristic [Mg(H(2)O)(6)](2+)binding modes. One mode has the ion binding in the deep major groove of a GpN step at the O6/N7 sites of guanine bases via hydrogen bonds. Our crystallographic observations are consistent with the recent NMR observations that in solution [Co(NH(3))(6)](3+), a model ion of [Mg(H(2)O)(6)](2+), binds in an identical manner. The other mode involves the binding of the ion to phosphates, bridging across the outer mouth of the narrow major groove. These [Mg(H(2)O)(6)](2+)ions are found at the most negative electrostatic potential regions of A-form duplexes. We propose that these two binding modes are important in the global charge neutralization, and therefore stability, of A-form duplexes.