BARCELONA, Spain -- Atletico Madrid rallied for a dramatic 1-1 draw at Barcelona on Saturday to secure its first Spanish league title in 18 years.

Atletico lost Diego Costa and Arda Turan to injury inside 22 minutes and Barcelona seized control at the Camp Nou in the 34th minute when Alexis Sanchez drove an unstoppable shot into the near corner.

Despite the setback, Atletico emerged from the break determined with Diego Godin heading home a corner in the 49th just after David Villa had hit the post.

Atletico needed to avoid defeat to secure the title and it weathered Barcelona's pressure in a frantic finish to cap an improbable domestic success.

Atletico's 10th title meant a club besides Barcelona or Real Madrid was Spanish champion for the first time since Valencia in 2004.

Even the 90,000-strong Camp Nou crowd appeared to appreciate the feat as it rained cheers of "Atleti" down on the players as they celebrated a victory that looked uncertain after it lost two of its best attacking players.

But Godin's fierce header from Koke's corner allowed Atletico to finish the 38-game season with 90 points. Barcelona finished second on 87, the same points tally as Real Madrid after it closed the season with a 3-1 win over Espanyol.

"We fought all season long, hanging on against difficult teams and against Real Madrid and Barcelona," Godin said. "We felt the pressure, a lot of things were going against us. But the coach told us just to be confident and believe in ourselves and the goal would come."

It was only the third time the championship had been decided by two challengers on the final day, and the first time since 1951. Atletico had done it the first time in 1946.

Atletico contained Lionel Messi for the sixth time this season as the Argentina forward had a second-half goal ruled offside to keep him off the scoresheet.

Not since Espanyol in 1939-40 has a club gone unbeaten in six games in a season against Barcelona, with five of those matches draws and Atletico's lone victory knocking the Catalans out of the Champions League.

Barcelona finishes the season without a major trophy for the first time since 2008.

Madrid will be Atletico's next challenge as the city rivals face off in the Champions League final on May 24.