Measurements of the production cross section of a Z boson in association with jets in proton–proton collisions at √s=13 TeV are presented, using data corresponding to an integrated luminosity of 3.16 fb−1 collected by the ATLAS experiment at the CERN Large Hadron Collider in 2015. Inclusive and differential cross sections are measured for events containing a Z boson decaying to electrons or muons and produced in association with up to seven jets with pT>30 GeV and |y|<2.5. Predictions from different Monte Carlo generators based on leading-order and next-to-leading-order matrix elements for up to two additional partons interfaced with parton shower and fixed-order predictions at next-to-leading order and next-to-next-to-leading order are compared with the measured cross sections. Good agreement within the uncertainties is observed for most of the modelled quantities, in particular with the generators which use next-to-leading-order matrix elements and the more recent next-to-next-to-leading-order fixed-order predictions.