  Kilonovae are a novel class of astrophysical transients, and the only
observationally-confirmed site of rapid neutron capture nucleosynthesis (the
r-process) in the Universe. To date, only a handful of kilonovae have been
detected, with just a single spectroscopically-observed event (AT 2017gfo).
Spectra of AT 2017gfo provided evidence for the formation of elements heavier
than iron; however, these spectra were collected during the first ~ 10 days,
when emission from light r-process elements dominates the observations. Heavier
elements, if synthesised, are expected to shape the late-time evolution of the
kilonova, beyond the phases for which we have spectral observations. Here we
present spectroscopic observations of a rapidly-reddening thermal transient,
following the gamma-ray burst, GRB 230307A. Early (2.4 day) optical
spectroscopy identifies the presence of a hot (T ~ 6700 K) thermal continuum.
By 29 days, this component has expanded and cooled significantly (T ~ 640 K),
yet it remains optically thick, indicating the presence of high-opacity ejecta.
We show that these properties can only be explained by the merger of compact
objects, and further, leads us to infer the production of the heavy lanthanide
elements. We identify several spectral features (in both absorption and
emission), whose cause can be explained by newly-synthesised heavy elements.
This event marks only the second recorded spectroscopic evidence for the
synthesis of r-process elements, and the first to be observed at such late
times.
