Madrid: Lionel Messi scored a hat-trick to become Barcelona's all-time leading scorer on 234 goals in a 5-3 win over Granada on Tuesday which moved the champions to within five points of Real Madrid at the top of La Liga.

It was Barca's sixth consecutive league win and put pressure on Madrid ahead of their trip to Villarreal yesterday, three days after Jose Mourinho's side dropped two points in a 1-1 draw at home to Malaga.

Barcelona coach Pep Guardiola praised the record-breaking Argentinian.

"We have to congratulate Messi, he has scored so many goals and is only 24, he does not just score ordinary goals but great goals and we hope he gets lots more for us, we can compare him perhaps to Michael Jordan in football," he said.

Xavi Hernandez and Messi hit the net for Barcelona in the first half before Diego Mainz reduced arrears for the Andalusians on 55 minutes.

Surpassing Rodriguez

In doing so, Messi equalled the record of 232 goals held by club legend Cesar Rodriguez.

Guilherme Siqueira levelled from the spot for the away side seven minutes later after Dani Alves pulled down Dani Benitez, raising the prospect of a possible upset.

However, those fears lasted only minutes as Messi produced a trademark chip over Granada's Brazilian keeper Julio Cesar in the 67th minute to put Barcelona 3-2 ahead.

Cristian Tello then drove the ball into the net after Messi's shot was parried by Cesar to make it 4-2 for the hosts, and Messi followed up with another fine piece of individual skill to make it 5-2 in the 86th minute.

Dani Alves received a second yellow card on 88 minutes for handling the ball in the area and Siqueira scored from the spot again, moments before the final whistle.

Previously, Cesar was believed to have scored 235 goals for Barcelona, but a study had revealed that the 1950's striker had in fact scored 232 goals — a statistic confirmed earlier on Tuesday on Barca's website.

Ronaldo close behind

Messi's latest hat-trick, taking his Barca total to 234, also made it 34 goals so far in the league, two more than Real Madrid striker Cristiano Ronaldo.

Earlier on Tuesday evening, Osasuna and Getafe drew 0-0 in an uneventful match.

The result means both teams edge a point closer to the objective of safety that both managers have set for their sides this week.

However, an Osasuna victory would have temporarily placed the side from Pamplona in fourth position and in a Champions League qualifying place.

Instead, Osasuna remain sixth on 40 points, a point behind fourth placed Levante, while Getafe sit four points behind in 11th.

The game burst into life just before half-time when first Juan Martinez ‘Nino' for Osasuna and then Jose Jimenez ‘Mane' for Getafe had chances to open the scoring. However, the second-half failed to continue in the same vein and chances were scarce as both teams seemed content to record a third successive 0-0 draw in this fixture.

Spanish media, meanwhile, hailed Barcelona's Lionel Messi on Wednesday as "a living legend" and "eternal" after the Argentine striker became the club's highest goal-scorer of all time.

"Messi rewrites history," daily newspaper La Vanguardia wrote on its front page below a picture of a smiling Messi celebrating one of his three goals during Barcelona's 5-3 win over Granada Tuesday in a Spanish league match.

"Historical!" said Barcelona-based sports daily Mundo Deportivo on its front page above a photo of the 24-year-old with both arms raised in the air with clenched fists. "A living legend, that is what Messi is. A 24-year-old youth who rides to infinity and who appears to have no limits," the newspaper added.