Two space missions dedicated to Mercury (MESSENGER and BepiColombo) aim at understanding its rotation and confirming the existence of a liquid core. This double challenge requires much more accurate models for the spin-orbit resonant rotation of Mercury. The purpose of this paper is to introduce planetary perturbations on Mercury’s rotation using an analytical method and to analyse the influence of the perturbations on the libration in longitude. Applying a perturbation theory based on the Lie triangle, we were able to re-introduce short periodic terms into the averaged Hamiltonian and to compute the evolution of the rotational variables. The perturbations on Mercury’s forced libration in longitude mainly come from the orbital motion of Mercury (with an amplitude around 41 arcsec that depends on the momenta of inertia). It is completed by various effects from Jupiter (11.86 and 5.93 year-periods), Venus (with a 5.66 year-period), Saturn (14.73 year-period), and the Earth (6.58 year-period). The amplitudes of the oscillations due to Jupiter and Venus are approximately 33% and 10% of those from the orbital motion of Mercury and the amplitudes of the oscillations due to Saturn and the Earth are approximately 3% and 2%. We compare the analytical results with the solution obtained from the spin-orbit numerical model SONYR.