  State-of-the-art optical clocks achieve fractional precisions of $10^{-18}$
and below using ensembles of atoms in optical lattices or individual ions in
radio-frequency traps. Promising candidates for novel clocks are highly charged
ions (HCIs) and nuclear transitions, which are largely insensitive to external
perturbations and reach wavelengths beyond the optical range, now becoming
accessible to frequency combs. However, insufficiently accurate atomic
structure calculations still hinder the identification of suitable transitions
in HCIs. Here, we report on the discovery of a long-lived metastable electronic
state in a HCI by measuring the mass difference of the ground and the excited
state in Re, the first non-destructive, direct determination of an electronic
excitation energy. This result agrees with our advanced calculations, and we
confirmed them with an Os ion with the same electronic configuration. We used
the high-precision Penning-trap mass spectrometer PENTATRAP, unique in its
synchronous use of five individual traps for simultaneous mass measurements.
The cyclotron frequency ratio $R$ of the ion in the ground state to the
metastable state could be determined to a precision of $\delta R=1\cdot
10^{-11}$, unprecedented in the heavy atom regime. With a lifetime of about 130
days, the potential soft x-ray frequency reference at $\nu=4.86\cdot
10^{16}\,\text{Hz}$ has a linewidth of only $\Delta \nu\approx 5\cdot
10^{-8}\,\text{Hz}$, and one of the highest electronic quality factor
($Q=\frac{\nu}{\Delta \nu}\approx 10^{24}$) ever seen in an experiment. Our low
uncertainty enables searching for more HCI soft x-ray clock transitions, needed
for promising precision studies of fundamental physics in a thus far unexplored
frontier.
