Real had earlier slumped to a 1-0 defeat at Athletic Bilbao, goalkeeper Gorka Iraizoz pulling off a string of superb saves to deny the visitors' expensively-assembled strikeforce after Fernando Llorente's third-minute opener. With just under half the season gone, unbeaten Barca have 46 points from 18 matches, Real are on 41, and Valencia, who host local rivals Villarreal on Sunday, are third with 35.
"Athletic are a very strong side and they knew very well how to defend the lead they managed to get so early in the game," Real coach Manuel Pellegrini said at a news conference. Holders Barca were ousted from the King's Cup by Sevilla on Wednesday and Pep Guardiola's players looked hungry for revenge at a rainy Nou Camp.
Zlatan Ibrahimovic, Thierry Henry and Messi all went close before Sevilla defender Julien Escude diverted a Rafael Marquez cross high into his own net in the 49th minute. A perfectly weighted, defence-splitting pass from midfielder Xavi released substitute Pedro with 20 minutes left and his delicate chip beat advancing Sevilla goalkeeper Andres Palop.
Messi, who grabbed a hat-trick at promoted Tenerife last weekend, finished from close range in the 85th and then raced on to an Eric Abidal pass in the first minute of added time to score his 14th goal of the campaign, two more in the scoring charts than nearest rival David Villa of Valencia.