© 2019 CERN. for the LHCb Collaboration. Published by the American Physical Society under the terms of the »https://creativecommons.org/licenses/by/4.0/» Creative Commons Attribution 4.0 International license. Further distribution of this work must maintain attribution to the author(s) and the published article's title, journal citation, and DOI. Funded by SCOAP 3 . We report a measurement of the mass difference between neutral charm-meson eigenstates using a novel approach that enhances sensitivity to this parameter. We use 2.3×106 D0→KS0π+π- decays reconstructed in proton-proton collisions collected by the LHCb experiment in 2011 and 2012. Allowing for CP violation in mixing and in the interference between mixing and decay, we measure the CP-averaged normalized mass difference xCP=[2.7±1.6(stat)±0.4(syst)]×10-3 and the CP-violating parameter Δx=[-0.53±0.70(stat)±0.22(syst)]×10-3. The results are consistent with CP symmetry. These determinations are the most precise from a single experiment and, combined with current world-average results, yield the first evidence that the masses of the neutral charm-meson eigenstates differ.