MADRID (AP) — Not even an injury to Lionel Messi in the 2-1 victory over Atletico Madrid on Sunday could dampen Barcelona's celebrations at winning its 22nd Spanish league title.

Messi started his first match in six rounds because of a recurring right hamstring injury, but he left the field in the 68th minute with Barcelona trailing 1-0 to Radamel Falcao's 52-minute goal and having made all three substitutions.

However, Alexis Sanchez leveled in the 72nd and Atletico midfielder Gabi Fernandez scored an own goal in the 80th to restart Barcelona's party for winning the title that was clinched when Real Madrid's title defense ended with a draw late Saturday.

Barcelona's hard-fought win keeps it on pace to match Madrid's record haul of 100 points from last season. The Catalan club needs to win its remaining three matches to reach the mark.

"This title has more merit and maybe we value it more because we didn't win it last year," said Barcelona defender Gerard Pique. "It's juicier and we are enjoying it more. Reaching 100 points would be special, but we'll have to fight to win the final three games."

While the team savored the comeback, the real festivities with its fans will be back in Barcelona on Monday when the players and staff are paraded through the city center.

On the down side, Barcelona said Messi had re-injured his hamstring and would undergo tests.

Messi's early finish to the match meant he finally failed to find the net after having scored in a record 21 consecutive Spanish league appearances, smashing the old milestone of 10.

Barcelona coach Tito Vilanova took time to thank his players for continuing to win without him this winter when he had to step aside to treat a throat tumor.

"It's quite remarkable what my players have done this season," the first-year head coach said. "I have already said that this could have only happened in this club, spending two months without a head coach and not letting it affect anything. That's because all these players feel at home here, they feel like the club belongs to them."

Atletico's players lined up to pay tribute to Barcelona with a guard of honor before the match. But with coach Diego Simeone declining to rest his starters for the Copa del Rey final against Madrid on Friday, it was clear they were aiming to spoil the visitors' title celebrations.

True to style, Barcelona controlled possession in the first half, but it was unable to convert any chances.

Forward Cristian Tello went the closest when he picked up a loose ball on the left side of the area and flashed a curling strike just past the far post in first-half injury time.

Messi also threatened with his dribbling through the middle, but the Argentina forward sent his best chance on goal sailing high over the bar.

Barcelona lost right back Dani Alves to an apparent injury in the 42nd minute, with Marc Bartra replacing him.

Bartra's poor pass led to Atletico going in front. Gabi set up Falcao after falling to the ground, leaving the Colombia striker to size up goalkeeper Jose Pinto and drive the ball under him for his 27th league goal this season.

When Messi walked off, seemingly to be checked by team doctors in the changing room, Atletico looked poised to seal the win as it had an extra man, the lead, and no Messi to worry about.

"Messi left the pitch with pain in the same area he hurt last month," Vilanova said. "He felt something strange and had to leave. Monday we will do tests and know the days or weeks he will be out, but before the game he felt fine."

But Alexis linked up with Cesc Fabregas after a harmless throw-in, working a one-two combination to break down Atletico's defense before poking the ball home.

Messi returned to the bench in street clothes to watch his teammates' complete their comeback with a little bit of luck, David Villa's off-target strike taking a deflection off Gabi and squeezing into the net.

Elsewhere on Sunday, Roberto Soldado scored twice to lead Valencia to a 4-0 win at Rayo Vallecano, provisionally lifting the team into fourth place and giving it control of Spain's final Champions League berth.

Valencia moved one point ahead of Real Sociedad before the Basque club hosts Granada on Monday.

Barcelona, Madrid, and Atletico Madrid have already locked up the other three Champions League berths.

Malaga and Sevilla drew 0-0, while Real Betis kept Celta Vigo in the relegation zone with a 1-0.