A search for the flavour-changing neutral-current decay t→qZ is presented. Data collected by the ATLAS detector during 2012 from proton–proton collisions at the Large Hadron Collider at a centre-of-mass energy of √s = 8 TeV, corresponding to an integrated luminosity of 20.3 fb-1, are analysed. Top-quark pair-production events with one top quark decaying through the t→qZ (q=u,c) channel and the other through the dominant Standard Model mode t→bW are considered as signal. Only the decays of the Z boson to charged leptons and leptonic W boson decays are used. No evidence for a signal is found and an observed (expected) upper limit on the t→qZ branching ratio of 7×10-4 (8×10-4) is set at the 95 % confidence level.