Thorium-229 is a unique case in nuclear physics: it presents a metastable first excited state 229m Th, just a few electronvolts above the nuclear ground state. This so-called isomer is accessible by VUV lasers, which allows transferring the amazing precision of atomic laser spectroscopy to nuclear physics. Being able to manipulate the 229 Th nuclear states at will opens up a multitude of prospects, from studies of the fundamental interactions in physics to applications as a compact and robust nuclear clock. However, direct optical excitation of the isomer or its radiative decay back to the ground state has not yet been observed, and a series of key nuclear structure parameters such as the exact energies and half-lives of the low-lying nuclear levels of 229 Th are yet unknown. Here we present the first active optical pumping into 229m Th. Our scheme employs narrow-band 29 keV synchrotron radiation to resonantly excite the second excited state, which then predominantly decays into the isomer. We determine the resonance energy with 0.07 eV accuracy, measure a half-life of 82.2 ps, an excitation linewidth of 1.70 neV, and extract the branching ratio of the second excited state into the ground and isomeric state respectively. These measurements allow us to re-evaluate gamma spectroscopy data that have been collected over 40 years.