MADRID (AP) -- MADRID (AP) -- Lionel Messi's sublime chip capped a four-goal performance as the three-time Ballon d'Or winner moved past the 40-goal mark for a third straight season in mesmerizing fashion to lead Barcelona's 5-1 thrashing of Valencia on Sunday.
Barcelona had to come from behind to stay within 10 points of Real Madrid, easily answering the Spanish leader's 4-0 rout of Racing Santander one night earlier with a pure display of the football that has crowned it the world's best team.
The undoubted star was Messi, who chipped goalkeeper Diego Alves after being put through by Sergio Busquets for his 27th league goal, 42nd in all competitions and 146th for Barcelona -- and in his 200th appearance for the club.
"The team played an incredible game. Some days you play well and some days you play poorly but what important is the team wins," said Messi, whose only other four-goal performance was against Arsenal in the Champions League nearly two years ago.
Valencia had the early momentum, however, thanks to a ninth-minute goal when Sofiane Feghouli picked out Pablo Piatti's run into the area with a perfectly floated cross for the Argentine to guide the ball past goalkeeper Victor Valdes.
Valdes wouldn't be called into action again until midway through the second half to deny Feghouli as the visitors played without Ever Banega, who needed surgery for a fractured left ankle earlier Sunday after his car reportedly ran over it.
Messi's first goal was memorable, collecting a loose ball inside the area and dribbling near to the goal line, patiently waiting for Alves to commit before sliding it under the goalkeeper in the 22nd minute.
Messi had a chance blocked in the 26th before scoring a minute later, the Argentina captain jumping on the rebound to poke the ball into the roof of the net after Alves had initially saved his first shot.
Barcelona then simply overwhelmed Valencia, with Cesc Fabregas often coming close, including a spectacular 40th-minute swerving volley that struck the crossbar.
Alves was Valencia's standout player, stopping at least a dozen shots, including from substitute Cristian Tello. The rebound, however, allowed Messi to power home a left-footed shot in the 76th to ensure his fifth hat trick of the season, matching Romario's feat for the club during the 1993-94 season.
Messi then moved within one goal of Cristiano Ronaldo's league-leading total of 28 with his fourth.
Barcelona was coming off a 3-1 win at Bayer Leverkusen in the Champions League on Tuesday and missing the suspended Daniel Alves and Javier Mascherano. But returning were Gerard Pique and Xavi Hernandez, who came off the bench to score the last in stoppage time.
"How many teams have won things and then fallen apart the next season, and the next?" asked Barcelona coach Pep Guardiola, who has had to fend continuous questions over his future as he takes his time on deciding on a contract extension. "Not these players."
Earlier, Athletic Bilbao scored three goals in four second-half minutes to beat Malaga 3-0 while Levante's early season success continued to unravel during a winless 2012 after a 5-3 loss to Rayo Vallecano.
Malaga dominated the first half at the San Mames with 14 shots, but conceded in the 58th minute to Fernando Amorebieta before Mikel San Jose headed home a corner kick in the 60th. Gaizka Toquero completed the reversal by sliding into Ander Herrera's cross-goal pass to volley home from a tight angle.
"We didn't allow any scoring chances and we created them," said Bilbao coach Marcelo Bielsa, whose decision to bring on Fernando Llorente for the second half also helped spark his attack. "We defended and attacked a little better in the second half."
Espanyol, which drew 1-1 at Getafe on Saturday, and Athletic share fourth and the last Champions League qualifying spot behind Valencia, with Atletico Madrid and Levante a further point back. New Sporting Gijon coach Javier Clemente began with a 1-1 draw against Atletico, which remains unbeaten under coach Diego Simeone.
Lass Bangoura and Diego Costa both scored two goals as Rayo won its third straight match to move within two points of fourth place alongside Malaga.
Also on Sunday, Ikechukwu Uche scored two goals as Granada rallied to beat 10-man Real Sociedad 4-1 and Victor Casadesus' brace powered Mallorca to a 4-0 win over Villarreal.
On Monday, last-place Zaragoza plays Real Betis.