  The rotation of Mercury is presently captured in a 3/2 spin-orbit resonance
with the orbital mean motion. The capture mechanism is well understood as the
result of tidal interactions with the Sun combined with planetary
perturbations. However, it is now almost certain that Mercury has a liquid
core, which should induce a contribution of viscous friction at the core-mantle
boundary to the spin evolution. This last effect greatly increases the chances
of capture in all spin-orbit resonances, being 100% for the 2/1 resonance, and
thus preventing the planet from evolving to the presently observed
configuration. Here we show that for a given resonance, as the chaotic
evolution of Mercury's orbit can drive its eccentricity to very low values
during the planet's history, any previous capture can be destabilized whenever
the eccentricity becomes lower than a critical value. In our numerical
integrations of 1000 orbits of Mercury over 4 Gyr, the spin ends 99.8% of the
time captured in a spin-orbit resonance, in particular in one of the following
three configurations: 5/2 (22%), 2/1 (32%) and 3/2 (26%). Although the present
3/2 spin-orbit resonance is not the most probable outcome, we also show that
the capture probability in this resonance can be increased up to 55% or 73%, if
the eccentricity of Mercury in the past has descended below the critical values
0.025 or 0.005, respectively.
