Half of all the elements in the universe heavier than iron were created by rapid neutron capture. The theory for this astrophysical 'r-process' was worked out six decades ago and requires an enormous neutron flux to make the bulk of these elements. 1 Where this happens is still debated. 2 A key piece of missing evidence is the identification of freshly-synthesised r-process elements in an astrophysical site. Current models 3-5 and circumstantial evidence 6 point to neutron star mergers as a probable r-process site, with the optical/infrared 'kilonova' emerging in the days after the merger a likely place to detect the spectral signatures of newly-created neutron-capture elements. 7-9 The kilonova, AT2017gfo, emerging from the gravitational-wave-discovered neutron star merger, GW170817, 10 was the first kilonova where detailed spectra were recorded. When these spectra were first reported 11, 12 it was argued that they were broadly consonant with an outflow of radioactive heavy elements, however, there was no robust identification of any element. Here we report the identification of the neutron-capture element strontium in a re-analysis of these spectra. The detection of a neutron-capture element associated with the collision of two extreme-density stars establishes the origin of r-process elements in neutron star mergers, and demonstrates that neutron stars comprise neutron-rich matter 13 .The most detailed information available for a kilonova comes from a series of spectra of AT2017gfo taken over several weeks with the medium resolution, ultraviolet (320 nm) to near-infrared (2,480 nm) spectrograph, X-shooter, mounted at the Very Large Telescope at the European Southern Observatory. These spectra 11, 12 , allow us to track the evolution of the kilonova's primary electromagnetic output from 1.5 days until 10 days after the event. Detailed modelling of these spectra has yet to be done owing to the limited understanding of the phenomenon and the expectation that a very large number of moderate to weak lanthanide lines with unknown oscillator strengths would dominate the spectra 14,15 . Despite the expected complexity, we sought to identify individual elements in the early spectra because these spectra are well-reproduced by relatively simple models 11 .The first epoch spectrum can be reproduced over the entire observed spectral range with a single-temperature blackbody with an observed temperature 4, 800 K. The two major deviations short of 1 µm from a pure blackbody are due to two very broad (∼ 0.2c) absorption components. These components are observed centred at about 350 nm and 810 nm (Fig. 1). The shape of the ultraviolet absorption component is not well constrained because it lies close to the edge of our sensitivity limit and may simply be cut off below about 350 nm. The presence of the absorption feature at 810 nm at this epoch has been noted in earlier publications 11,12 .The fact that the spectrum is very well reproduced by a single temperature blackbody in the first epoch suggests a population of states 0.3...