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 to get back in the match with Diego Godin heading home a corner in the 49th just after David Villa 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.

"Today we could make history," Atletico coach Diego Simeone said. "Not at any moment did I feel that the game was getting away from my team. I know them. I knew they could respond, and the bigger the challenge, the better."

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. Five of those matches were draws and Atletico's lone victory knocked the Catalan side out of the Champions League.

Barcelona finished 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 next Saturday.

Atletico's attack was dealt a major blow when striker Diego Costa and attacking midfielder Turan had to exit the match. Both players wept on leaving the pitch after Diego Costa came up lame following a sprint in the 14th and Turan went out after knocking his right hip.

Alexis undid Atletico's defence with a powerful strike from a tight angle after Messi chested down Cesc Fabregas' pass and then smartly stepped aside for the Chile forward to smash the ball inside the post.

Instead of collapsing, Atletico showed the toughness that had gotten it to the finale by finishing the half well with a flurry of corner kicks that Barcelona struggled to defend.

Simeone, who was playing for Atletico the last time the club won the title in 1996, said he told his team at halftime that they were still in it despite trailing and missing two of their most important players in attack.

"I told them that we were fine and to go out strong and make the most out of our chances, and that when we scored another game would begin."

Atletico increased its pressure after the restart and got its all-important equalizer moments after Villa fired the ball off the base of the post.

Another corner kick provided the opportunity Godin needed to head Gabi Fernandez's service off the turf and under goalkeeper Jose Pinto, sending the small contingent of Atletico faithful perched at the top of the stadium into raptures.

Barcelona tried to gather itself with Neymar going on in the 63rd after a monthlong absence due to injury.

But Simeone, who never stopped pacing the sideline in his solid black suit, watched his team hold Barcelona without a shot on target in the second half until Dani Alves tested Thibaut Courtois from long range with nine minutes to play.

Barcelona mustered one last effort with Pique moving up as an extra attacker but to no avail, as Simeone's pleas for the referee to blow the final whistle were at last answered.

Several Atletico players collapsed to the ground while Simeone, his staff and reserves rushed out to join them.

Barcelona's players congratulated the victors but as they walked off to leave Atletico to celebrate, the applause from Camp Nou for the champions turned to jeers for a Barcelona side that finished the season without a major title for the first time since 2007-08.

Simeone was hoisted up and down by his players before the Argentine went into the stands to embrace his father.