A search for the pair production of heavy leptons as predicted by the type-III seesaw mechanism is presented. The search uses proton–proton collision data at a centre-of-mass energy of 13 TeV, corresponding to 139fb−1 of integrated luminosity recorded by the ATLAS detector during Run 2 of the Large Hadron Collider. The analysis focuses on the final state with two light leptons (electrons or muons) of different flavour and charge combinations, with at least two jets and large missing transverse momentum. No significant excess over the Standard Model expectation is observed. The results are translated into exclusion limits on heavy-lepton masses, and the observed lower limit on the mass of the type-III seesaw heavy leptons is 790 GeV at 95% confidence level.