Riboswitch RNAs fold into complex tertiary structures upon binding to their cognate ligand. Ligand recognition is accomplished by key residues in the binding pocket. In addition, it often crucially depends on the stability of peripheral structural elements. The ligand-bound complex of the guanine-sensing riboswitch from Bacillus subtilis, for example, is stabilized by extensive interactions between apical loop regions of the aptamer domain. Previously, we have shown that destabilization of this tertiary loop–loop interaction abrogates ligand binding of the G37A/C61U-mutant aptamer domain (Gswloop) in the absence of Mg2+. However, if Mg2+ is available, ligand-binding capability is restored by a population shift of the ground-state RNA ensemble toward RNA conformations with pre-formed loop–loop interactions. Here, we characterize the striking influence of long-range tertiary structure on RNA folding kinetics and on ligand-bound complex structure, both by X-ray crystallography and time-resolved NMR. The X-ray structure of the ligand-bound complex reveals that the global architecture is almost identical to the wild-type aptamer domain. The population of ligand-binding competent conformations in the ground-state ensemble of Gswloop is tunable through variation of the Mg2+ concentration. We quantitatively describe the influence of distinct Mg2+ concentrations on ligand-induced folding trajectories both by equilibrium and time-resolved NMR spectroscopy at single-residue resolution.