  A measurement of the electroweak (EW) production of two jets in association
with a Z boson in proton-proton collisions at $\sqrt{s} = $ 13 TeV is
presented, based on data recorded in 2016 by the CMS experiment at the LHC
corresponding to an integrated luminosity of 35.9 fb$^{-1}$. The measurement is
performed in the $\ell\ell\mathrm{jj}$ final state with $\ell$ including
electrons and muons, and the jets j corresponding to the quarks produced in the
hard interaction. The measured cross section in a kinematic region defined by
invariant masses $m_{\ell\ell} > $ 50 GeV, $m_{\mathrm{jj}} > $ 120 GeV, and
transverse momenta $p_{\mathrm{T j}} > $ 25 GeV is
$\sigma_\mathrm{EW}(\ell\ell\mathrm{jj})= $ 534 $\pm$ 20 (stat) $\pm$ 57 (syst)
fb, in agreement with leading-order standard model predictions. The final state
is also used to perform a search for anomalous trilinear gauge couplings. No
evidence is found and limits on anomalous trilinear gauge couplings associated
with dimension-six operators are given in the framework of an effective field
theory. The corresponding 95% confidence level intervals are $-2.6 <
c_{WWW}/\Lambda^2 < 2.6 $ TeV$^{-2}$ and $-8.4 < c_{W}/\Lambda^2 < 10.1 $
TeV$^{-2}$. The additional jet activity of events in a signal-enriched region
is also studied, and the measurements are in agreement with predictions.
