Pablo Piatti scored in the 9th minute for Valencia, which could have closed to within five points of Barcelona for second place with a win, but Messi grabbed control of the match from there.
Messi had goals in the 22nd, 27th, 76th and 85th minutes, as Barca revived its faint title hopes. The Argentina international notched all four goals with his lethal left foot and has 27 goals in La Liga this season, one behind Cristiano Ronaldo of Real Madrid for the lead.
Barca lost to Osasuna, 3-2, last week to start speculation that the title race was already over. Real piled more pressure on Saturday with a 4-0 victory over 10-man Racing, but Messi made sure Barca responded.
With a league match remaining against Real Madrid, it's still far too early to count Barcelona out, even if the 10-point deficit is daunting.
Mallorca 4, Villarreal 0
Mallorca, Spain - V���ctor Casadesus scored twice as Mallorca left Villarreal on relegation danger with a 4-0 win Sunday at the Estadio Son Moix in La Liga.
Casadesus opened the scoring late in the first half, and added a second during a three-goal second half that sealed Mallorca's third win its last five games.
Mallorca is 12th, just four points out of a European spot and just five points above the bottom three. Jose Luis Marti and Nunes scored the other goals for Mallorca.
Villarreal was unbeaten in its last four La Liga matches, with three wins over that span, but its ninth loss of the season leaves the Yellow Submarines just three points out of the bottom three in 17th.
Rayo Vallecano 5, Levante 3
Valencia, Spain - Lass and Diego Da Silva Costa each scored twice to lead Rayo Vallecano to a 5-3 win over Levante on Sunday at the Ciutat de Valencia in La Liga.
Costa snapped a 1-1 draw when he scored both of his goals in a 3-minute run of the second half, and Lass notched his second goal in the 70th to put Vallecano up three goals.
Andrija Delibasic also scored for Rayo Vallecano, while Ruben Suarez scored a late brace and Jose Barkero also scored for struggling Levante.
Vallecano won its third straight to move into the top half of the table, while Levante slipped to seventh as its winless streak reached eight matches.
Granada 4, Real Sociedad 1
Granada, Spain - Ikechukwu Uche scored twice as Granada overcame an early goal from Real Sociedad in a 4-1 win Sunday at Los Carmenes in La Liga.
Mikel Gonzalez handed Sociedad the lead after 10 minutes, but Inigo Lopez tied the match within 2 minutes, and Illarramendi was sent off just before half for the visitors.
Franco Jara put Granada in front after 57 minutes, and Uche added a brace over the final half hour despite the sending off of teammate Guillherme Siqueira.
Granada won for the third time in its last four games to climb five points off the relegation zone. Sociedad lost for the third time in its last five, and is four points from danger.
Sporting Gijon 1, Atletico Madrid 1
Mallorca, Spain - Sebastian Eguren scored in the 37th minute to cancel out an early own goal, and Sporting Gijon tied Atletico Madrid 1-1 on Sunday at the Estadio Son Moix in La Liga.
Gijon, just one place off the bottom of the table, is winless in five straight league matches, but had lost three of its previous four. The result left Gijon six points from safety.
Atletico tied its third straight match during a seven-game undefeated run, but wasted a chance to move up to fourth and the Champions League qualifying spot.
Athletic Bilbao 3, Malaga 0
Bilbao, Spain - Fernando Amorebieta, Mikel San Jose and Gaizka Toquero all had goals in a 3-minute stretch of the second half, as Athletic Bilbao beat Malaga 3-0 on Sunday to improve its Champions League hopes for next season.
Amorebieta broke the deadlock on 58 minutes, San Jose followed in the 60th and Toquero capped the outburst in the 61st, as Bilbao solidified its place in the top six after 23 weeks.
Malaga lost for the eighth time in 12 road games, and sits just behind the top six in eighth place.