A search for pair production of doubly charged Higgs () bosons, each decaying into a pair of prompt, isolated, and 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 139 fb of integrated luminosity recorded during the Run 2 of the Large Hadron Collider by the ATLAS detector. This analysis focuses on same-charge leptonic decays, , where in two-, three-, and four-lepton channels, but only considers final states which include electrons or muons. No evidence of a signal is observed. Corresponding limits on the production cross-section and consequently a lower limit on are derived at 95% confidence level. Under the assumption that the branching ratios to each of the possible leptonic final states are equal, , the observed lower limit on the mass of a doubly charged Higgs boson is 1080 GeV, which represents an improvement over previous limits.