A search for the charged-lepton-flavor-violating process Z → eμ is presented, using 139 fb−1 of √s = 13 TeV pp collision data collected by the ATLAS experiment at the LHC. An excess in the eμ invariant mass spectrum near the Z boson mass would be a striking signature of new physics. No excess is observed, and an upper limit B(Z→eμ) < 2.62 × 10−7 is placed on the branching fraction at 95% confidence level, which is the most stringent limit to date.