Lionel Messi became Barcelona’s all-time leading scorer in style with a hat-trick in his side’s 7-0 demolition of Osasuna at the Camp Nou.

Already the club’s top scorer in competitive matches, Messi now leads the way including friendlies and non-official games having taken his tally to 371 to surpass the previous mark of 369 held by Paulinho Alcantara. His goals on Sunday, together with those from Alexis Sanchez, Andres Iniesta, Cristian Tello and Pedro, helped secure what was a vital win for Barcelona.

It keeps them four points behind Real Madrid and still in touch of the Primera Division leaders ahead of the final league Clasico of the season next Sunday. And they will go into the match in far better spirits than looked likely just a few days ago. After a woeful display in defeat to Real Valladolid last weekend, Tata Martino’s side have rebounded in impressive fashion having also secured their Champions League progress against Manchester City in midweek.

Yet Osasuna had caused Barcelona problems in the early stages. They even had the ball in the net in the first 10 minutes, although Oriol Riera was correctly adjudged offside when he tapped in. But when Barcelona got going they were remorseless.

It was Messi who began the rout on 18 minutes as he equaled Paulinho’s mark. The Argentine did well to get in front of a defender at the near post and direct a low Sanchez cross into the net. A second followed just four minutes later with Sanchez turning scorer and finishing well from Jordi Alba’s cross to get his 17th goal of the Primera Division season. Andres Iniesta had played his part in that goal and got on target himself 11 minutes before the interval. The midfielder hit a fine left-footed strike from 20 yards and afterward pointed to the sky, in a doubtless tribute to the child he recently lost when his wife suffered a miscarriage.

The three points were effectively sealed by half-time but that did nothing to halt Barcelona’s onslaught. In the 63rd minute, Iniesta and Messi combined with lovely intricate play inside the box before Messi finished past beleaguered Osasuna keeper Andres at the near post to add yet another record to his collection.

Barcelona then added insult to injury for their opponents in the final 12 minutes. First Tello grabbed his first league goal of the campaign in spectacular fashion with a curling effort from outside the box. Messi secured his treble with two minutes remaining, finishing coolly from Dani Alves’s pass, before he set up Pedro to complete the rout.