Owing to its low excitation energy and long radiative lifetime, the first excited isomeric state of thorium-229, .sup.229mTh, can be optically controlled by a laser.sup.1,2 and is an ideal candidate for the creation of a nuclear optical clock.sup.3, which is expected to complement and outperform current electronic-shell-based atomic clocks.sup.4. A nuclear clock will have various applications--such as in relativistic geodesy.sup.5, dark matter research.sup.6 and the observation of potential temporal variations of fundamental constants.sup.7--but its development has so far been impeded by the imprecise knowledge of the energy of .sup.229mTh. Here we report a direct measurement of the transition energy of this isomeric state to the ground state with an uncertainty of 0.17 electronvolts (one standard deviation) using spectroscopy of the internal conversion electrons emitted in flight during the decay of neutral .sup.229mTh atoms. The energy of the transition between the ground state and the first excited state corresponds to a wavelength of 149.7 [plus or minus] 3.1 nanometres, which is accessible by laser spectroscopy through high-harmonic generation. Our method combines nuclear and atomic physics measurements to advance precision metrology, and our findings are expected to facilitate the application of high-resolution laser spectroscopy on nuclei and to enable the development of a nuclear optical clock of unprecedented accuracy. The transition energy of the first excited state of .sup.229Th to the ground state is determined through the measurement of internal conversion electrons to correspond to a wavelength of 149.7 [plus or minus] 3.1 nanometres.