Divalent cations are important in the folding and stabilization of complex RNA structures. The adenine-sensing riboswitch controls the expression of mRNAs for proteins involved in purine metabolism by directly sensing intracellular adenine levels. Adenine binds with high affinity and specificity to the ligand binding or aptamer domain of the adenine-sensing riboswitch. The X-ray structure of this domain in complex with adenine revealed an intricate RNA-fold consisting of a three-helix junction stabilized by long-range base-pairing interactions and identified five binding sites for hexahydrated Mg2+-ions. Furthermore, a role for Mg2+-ions in the ligand-induced folding of this RNA was suggested. Here, we describe the interaction of divalent cations with the RNA–adenine complex in solution as studied by high-resolution NMR spectroscopy. Paramagnetic line broadening, chemical shift mapping and intermolecular nuclear Overhauser effects (NOEs) indicate the presence of at least three binding sites for divalent cations. Two of them are similar to those in the X-ray structure. The third site, which is important for the folding of this RNA, has not been observed previously. The ligand-free state of the RNA is conformationally heterogeneous and contains base-pairing patterns detrimental to ligand binding in the absence of Mg2+, but becomes partially pre-organized for ligand binding in the presence of Mg2+. Compared to the highly similar guanine-sensing riboswitch, the folding pathway for the adenine-sensing riboswitch aptamer domain is more complex and the influence of Mg2+ is more pronounced.