Experiments demonstrate that Mg(2+) is crucial for structure and function of RNA systems, yet the detailed molecular mechanism of Mg(2+) action on RNA is not well understood. We investigate the interplay between RNA and Mg(2+) at atomic resolution through ten 2-μs explicit solvent molecular dynamics simulations of the SAM-I riboswitch with varying ion concentrations. The structure, including three stemloops, is very stable on this time scale. Simulations reveal that outer-sphere coordinated Mg(2+) ions fluctuate on the same time scale as the RNA, and that their dynamics couple. Locally, Mg(2+) association affects RNA conformation through tertiary bridging interactions; globally, increasing Mg(2+) concentration slows RNA fluctuations. Outer-sphere Mg(2+) ions responsible for these effects account for 80% of Mg(2+) in our simulations. These ions are transiently bound to the RNA, maintaining interactions, but shuttled from site to site. Outer-sphere Mg(2+) are separated from the RNA by a single hydration shell, occupying a thin layer 3-5 Å from the RNA. Distribution functions reveal that outer-sphere Mg(2+) are positioned by electronegative atoms, hydration layers, and a preference for the major groove. Diffusion analysis suggests transient outer-sphere Mg(2+) dynamics are glassy. Since outer-sphere Mg(2+) ions account for most of the Mg(2+) in our simulations, these ions may change the paradigm of Mg(2+)-RNA interactions. Rather than a few inner-sphere ions anchoring the RNA structure surrounded by a continuum of diffuse ions, we observe a layer of outer-sphere coordinated Mg(2+) that is transiently bound but strongly coupled to the RNA.