  A measurement of mixing and $C\!P$ violation in neutral charm mesons is
performed using data reconstructed in proton-proton collisions collected by the
LHCb experiment from 2016 to 2018, corresponding to an integrated luminosity of
5.4$\textrm{fb}^{-1}$. A total of $30.6$ million $D^{0}\rightarrow
K^{0}_{\mathrm{S}}\pi^{+}\pi^{-}$ decays are analyzed using a method optimized
for the measurement of the mass difference between neutral charm-meson
eigenstates. Allowing for $C\!P$ violation in mixing and in the interference
between mixing and decay, the mass and decay-width differences are measured to
be $x_{C\!P} = \left[3.97\pm0.46\textrm{(stat)}\pm
0.29\textrm{(syst)}\right]\times10^{-3}$ and $y_{C\!P} =
\left[4.59\pm1.20\textrm{(stat)}\pm0.85\textrm{(syst)}\right]\times10^{-3}$,
respectively. The $C\!P$-violating parameters are measured as $\Delta x =
\left[-0.27\pm0.18\textrm{(stat)}\pm0.01\textrm{(syst)}\right]\times10^{-3}$
and $\Delta y =
\left[0.20\pm0.36\textrm{(stat)}\pm0.13\textrm{(syst)}\right]\times10^{-3}$.
This is the first observation of a nonzero mass difference in the $D^0$ meson
system, with a significance exceeding seven standard deviations. The data are
consistent with $C\!P$ symmetry, and improve existing constraints on the
associated parameters.
