  The production of a prompt photon in association with a $Z$ boson is studied
in proton-proton collisions at a centre-of-mass energy $\sqrt{s} =$ 13 TeV. The
analysis uses a data sample with an integrated luminosity of 139 fb$^{-1}$
collected by the ATLAS detector at the LHC from 2015 to 2018. The production
cross-section for the process $pp \rightarrow \ell^+\ell^-\gamma+X$ ($\ell = e,
\mu$) is measured within a fiducial phase-space region defined by kinematic
requirements on the photon and the leptons, and by isolation requirements on
the photon. An experimental precision of 2.9% is achieved for the fiducial
cross-section. Differential cross-sections are measured as a function of each
of six kinematic variables characterising the $\ell^+\ell^-\gamma$ system. The
data are compared with theoretical predictions based on next-to-leading-order
and next-to-next-to-leading-order perturbative QCD calculations. The impact of
next-to-leading-order electroweak corrections is also considered.
