Direct searches for lepton flavor violation in decays of the Z boson with the ATLAS detector at the LHC are presented. Decays of the Z boson into an electron or muon and a hadronically decaying r lepton are considered. The searches are based on a data sample of proton-proton collisions collected by the ATLAS detector in 2015 and 2016, corresponding to an integrated luminosity of 36.1 fb(-1) at a center-of-mass energy of root s = 13 TeV. No statistically significant excess of events above the expected background is observed, and upper limits on the branching ratios of lepton-flavor-violating decays are set at the 95% confidence level: B(Z -> e tau) < 5.8 x 10(-5) and B(Z -> mu tau) < 2.4 x 10(-5). This is the first limit on B(Z -> e tau) with ATLAS data. The upper limit on 13(Z -> mu tau) is combined with a previous ATLAS result based on 20.3 fb(-1) of proton protoncollision data at a center-of-mass energy of root s = 8 TeV and the combined upper limit at 95% confidence level is B(Z -> mu tau) < 1.3 x 10(-5).