Advanced techniques for manipulation of internal states, standard in atomic physics, are demonstrated for a charged molecular species for the first time. We address individual hyperfine states of ro-vibrational levels of a diatomic ion by optical excitation of individual hyperfine transitions, and achieve controlled transfer of population into a selected hyperfine state. We use molecular hydrogen ions (HD + ) as a model system and employ a novel frequency-comb-based, continuous-wave 5 µm laser spectrometer. The achieved spectral resolution is the highest obtained so far in the optical domain on a molecular ion species. As a consequence, we are also able to perform the most precise test yet of the ab-initio theory of a molecule.Cold trapped molecules [1, 2] currently represent an intense field of activity relying on sophisticated methods of molecule production, translational and internal cooling, spectroscopy and sensitive detection. Many applications, such as chemical reaction studies [3, 4], tests of molecular quantum theory [5], fundamental physics [6, 7] and quantum computing [8] would benefit strongly from the availability of advanced manipulation techniques, already standard in atomic physics. These are not straightforward for molecules, and for charged molecules have not been demonstrated yet. Production methods for molecular ions (usually by electron impact ionization) and, if heteronuclear, their interaction with the black-body radiation of the surrounding vacuum chamber, usually lead to significant population of a substantial number of internal states. A first, important step in the manipulation of internal states of molecular ions is population transfer between rotational states (heteronuclear molecules usually being cold vibrationally, i.e. are all in the v = 0 ground vibrational state). It has been demonstrated that a significant fraction (ca. 75%) of an ensemble of diatomic molecular ions can be pumped into the vibrational and rotational ground level (v = 0, N = 0) [9, 10], see Fig. 1.For a general diatomic molecule, however, this pumping is usually not capable of preparing molecules in a single quantum state, because spin interactions generate a hyperfine structure with several states in each ro-vibrational level. For example, a diatomic molecule with one unpaired electron (s e = 1/2), and nuclei with nuclear spins I 1 = 1/2, I 2 = 1 (such as HD + ) has 4 hyperfine states in zero magnetic field if the rotational angular momentum N = 0, but 10 if N = 1, and 12 if N ≥ 2, see Fig. 2 a. The ability to address selectively molecules in one particular hyperfine state (or even in a single quantum state with a particular magnetic quantum number J z ) and to transfer molecules from one hyperfine state to another are clearly important tools of a molecular quantum toolbox that can be part of a full quantum state preparation procedure.Complicating the addressing, the number of strong transitions between two given ro-vibrational levels (v, N ), (v , N ) is equal to the larger of the two numbers of hyperfine s...