The stellar-mass black hole merger GW190521 is the heaviest system discovered by LIGO/Virgo so far, with masses unexpected from stellar evolution. The system underwent precession due to its black hole spin orientation, a signature of binaries formed through gravitational capture. Capture through close encounters can also lead to eccentric binary orbits, but this feature is currently difficult to identify due to the lack of suitable gravitational waveforms. No eccentric merger has been reported to date. Here we show that GW190521 is the most consistent with a highly eccentric black hole merger. We carried out 325 numerical relativity simulations to generate an effective ∼3×104gravitational waveforms to compare to the observed data, much greater than previously available at high eccentricities. We find that GW190521 is best explained by a high-eccentricity, precessing model with e∼0.7. All properties of GW190521 point to its origin being the repeated gravitational capture of black holes, making GW190521 the first of LIGO/Virgo's discoveries whose formation channel is identified.