In a thrilling conclusion to the Spanish domestic season, there are now just two points separating Atletico Madrid, Real Madrid and Barcelona, which faces Atletico on Saturday.
Gabriel gave Valencia the lead shortly after halftime in Sunday’s game at the Mestalla Stadium when he headed in from a corner, but Barcelona scored three goals in 11 minutes to overturn the deficit.
Messi equalized having had a penalty saved by Jasper Cillessen and Antoine Griezmann tapped in from close range to give Barcelona the lead, before Messi got his second with a superb free-kick.
Carlos Soler’s long-range effort made it a tense final few minutes for Barcelona, but the visiting side held on.
“We’re still alive, we have to give the team a big compliment, the way they played,” said Barcelona’s assistant coach Alfred Schreuder.
“I think we played the first half very well, we created a lot of good opportunities. But after the 1-0 (lead) from Valencia I think we reacted very well.”
After losing to Grenada on Thursday, the victory moved Barcelona level on points with second-placed Real Madrid with four games remaining in the season.
Elsewhere, Inter Milan clinched its first Serie A title in 11 years, ending Juventus’ reign of dominance in Italian football.
Atalanta’s failure to win at Sassuolo, combined with Inter’s 2-0 victory over Crotone on Saturday, gave Antonio Conte’s side an unassailable lead at the top of the league.
Juventus, whose run of nine consecutive league titles has been ended by Inter, needed two late goals from Cristiano Ronaldo on Sunday to secure a 2-1 victory against Udinese.
In France, as in Spain, the top flight is set for a tense finale with one point separating Lille and Paris Saint-Germain at the top of the table.
AS Monaco and Lyon, the two teams in third and fourth in Ligue 1, played out a dramatic contest on Sunday.
The match included five red cards in total, four of which came as tempers flared at the final whistle, and finished 3-2 in Lyon’s favor after an 89th-minute winner from 17-year-old Rayan Cherki.