  A measurement of the inclusive cross section of top quark pair production in
association with a Z boson using proton-proton collisions at a center-of-mass
energy of 13 TeV at the LHC is performed. The data sample corresponds to an
integrated luminosity of 77.5 fb$^{-1}$, collected by the CMS experiment during
2016 and 2017. The measurement is performed using final states containing three
or four charged leptons (electrons or muons), and the Z boson is detected
through its decay to an oppositely charged lepton pair. The production cross
section is measured to be $\sigma(\mathrm{t\bar{t}Z})$ $=$ 0.95 $\pm$ 0.05
(stat) $\pm$ 0.06 (syst) pb. For the first time, differential cross sections
are measured as functions of the transverse momentum of the Z boson and the
angular distribution of the negatively charged lepton from the Z boson decay.
The most stringent direct limits to date on the anomalous couplings of the top
quark to the Z boson are presented, including constraints on the Wilson
coefficients in the framework of the standard model effective field theory.
