A search for lepton-flavor-violating Z→eτ and Z→μτ decays with pp collision data recorded by the ATLAS detector at the LHC is presented. This analysis uses 139 fb^{-1} of Run 2 pp collisions at sqrt[s]=13 TeV and is combined with the results of a similar ATLAS search in the final state in which the τ lepton decays hadronically, using the same data set as well as Run 1 data. The addition of leptonically decaying τ leptons significantly improves the sensitivity reach for Z→ℓτ decays. The Z→ℓτ branching fractions are constrained in this analysis to B(Z→eτ)<7.0×10^{-6} and B(Z→μτ)<7.2×10^{-6} at 95% confidence level. The combination with the previously published analyses sets the strongest constraints to date: B(Z→eτ)<5.0×10^{-6} and B(Z→μτ)<6.5×10^{-6} at 95% confidence level.