A search for doubly charged Higgs bosons with pairs of prompt, isolated, highly energetic leptons with the same electric charge is presented. The search uses a proton–proton collision data sample at a centre-of-mass energy of 13 TeV corresponding to 36.1 fb - 1 of integrated luminosity recorded in 2015 and 2016 by the ATLAS detector at the LHC. This analysis focuses on the decays H± ±→ e±e±, H± ±→ e±μ± and H± ±→ μ±μ±, fitting the dilepton mass spectra in several exclusive signal regions. No significant evidence of a signal is observed and corresponding limits on the production cross-section and consequently a lower limit on m(H± ±) are derived at 95% confidence level. With ℓ±ℓ±= e±e±/ μ±μ±/ e±μ±, the observed lower limit on the mass of a doubly charged Higgs boson only coupling to left-handed leptons varies from 770 to 870 GeV (850 GeV expected) for B(H± ±→ ℓ±ℓ±) = 100 % and both the expected and observed mass limits are above 450 GeV for B(H± ±→ ℓ±ℓ±) = 10 % and any combination of partial branching ratios.