  The first observation of the electroweak (EW) production of a Z boson, a
photon, and two forward jets (Z$\gamma$jj) in proton-proton collisions at a
center-of-mass energy of 13 TeV is presented. A data set corresponding to an
integrated luminosity of 137 fb$^{-1}$, collected by the CMS experiment at the
LHC in 2016-2018 is used. The measured fiducial cross section for EW
Z$\gamma$jj is $\sigma_{\mathrm{EW}}$ = 5.21 $\pm$ 0.52 (stat) $\pm$ 0.56
(syst) fb = 5.21 $\pm$ 0.76 fb. Single-differential cross sections in photon,
leading lepton, and leading jet transverse momenta, and double-differential
cross sections in $m_{\mathrm{jj}}$ and $\lvert\Delta\eta_{\mathrm{jj}}\rvert$
are also measured. Exclusion limits on anomalous quartic gauge couplings are
derived at 95% confidence level in terms of the effective field theory
operators $\mathrm{M}_{0}$ to $\mathrm{M}_{5}$, $\mathrm{M}_{7}$,
$\mathrm{T}_{0}$ to $\mathrm{T}_{2}$, and $\mathrm{T}_{5}$ to $\mathrm{T}_{9}$.
