Barcelona's Lionel Messi (left) battles for the ball against Malaga's Nacho Monreal during their La Liga soccer match in Barcelona, Spain.

Madrid - Barcelona kept alive a faint hope of catching leaders Real Madrid when Lionel Messi scored his seventh La Liga hat-trick of the campaign in a 4-1 win at home to Malaga on Wednesday.

The Argentine World Player of the Year also became the first man to score 68 goals in a season for a European top-flight club, breaking the record of 67 set by former Bayern Munich striker Gerd Mueller in 1972-73.

He has a record 46 in La Liga, three more than Real Madrid forward Cristiano Ronaldo.

Ronaldo's Real can wrap up the title, their 32nd overall and a first in four years, with a win at Athletic Bilbao in the later kickoff (20h00 GMT).

Jose Mourinho's side have 91 points with three matches left, with Barca, who have two games to play, on 87.

Barca captain Carles Puyol volleyed the champions ahead in the 13th minute at the Nou Camp, where home fans paid warm tribute to coach Pep Guardiola, who announced on Friday he was stepping down at the end of the season.

Salomon Rondon levelled with a glancing header in the 26th before Andres Iniesta was felled on the edge of the penalty area and Messi stroked in the spot kick.

The 24-year-old scored a second penalty, which he won himself, in the 59th minute and was played clear by Iniesta five minutes later before dinking the ball over Malaga goalkeeper Carlos Kameni and sliding it into the empty net.

Defeat for Malaga dents their chances of overhauling third-placed Valencia and clinching Spain's third automatic place in next season's Champions League.

Both have 55 points and Valencia can pull three clear with a win at home to Osasuna later on Wednesday.

Atletico Madrid's hopes of a lucrative place in next season's Champions League were dealt a huge blow when they had Gabi sent off and conceded a late equaliser in a 1-1 draw at home to Real Sociedad. - Reuters