A brace from late substitute Juanmi sealed a precious 3-0 win for Real Sociedad on Thursday to virtually end Atletico Madrid’s fading hopes of challenging for the Spanish league title.

With a 12-point deficit to Barcelona, Atletico were already facing an uphill task to overhaul the runaway La Liga leaders.

Now with only five games remaining, Diego Simeone’s men would be forgiven for focusing their remaining efforts on making sure they finish second ahead of Real Madrid – now just three points adrift – and their bid to win the Europa League.

Atletico face Arsenal in the semi-finals of Europe’s second tier competition next week.

Simeone warned on Tuesday his side would have to start improving if they were to stop star striker Antoine Griezmann from being lured to a rival club. Barcelona and England’s Premier League are, according to reports, his favoured destinations.

And after this performance, the Argentine should have even more reason for concern.

“Today, we played poorly in the first half and in the second half we improved at first, but didn’t have the consistency to find the equalizer,” said Simeone.

“We have to congratulate Real Sociedad because they played a great match and won fairly.”

Although well clear of the relegtion zone, this match was a matter of pride for Sociedad – and the hosts made it show on their way to handing Atletico only their fourth league defeat of the campaign.

Livelier from the outset, Sociedad took a 27th minute lead when Willian Jose pounced on a delivery from Belgian Adnan Januzaj to beat Jan Oblak down low.

Two minutes later Griezmann produced his first real threat, but the French forward’s left-footed effort from inside the area sailed high and wide.

The hosts responded well, Aritz Elustondo, and Sergio Canales, twice, testing Oblak’s reflexes before the half-time interval.

Simeone replaced Angel Correa with veteran Fernando Torres for the second half, but the former Liverpool striker failed to conjur up the magic.

Sociedad continued to press and, as a consequence, earned the lion’s share of chances in a dominant second half.

Raul Navas saw a header go just wide on the hour from a Canales cross while minutes later Oblak got down smart with his body to block a shot from Januzaj.

A Torres header sailed wide on 65 minutes and another header from Sime Vrsaljko moments later was also off target.

Juanmi replaced Mikel Oyarzabal on 71 minutes and sent the Anoeta stadium into raptures less than eight minutes later when he ran on to Jose’s ball to beat Oblak.

With no wind left in their sails, Atletico were cast adrift in added-on time when Juanmi beat the offside trap and ran on to a through ball to beat the onrushing Oblak with a delightful chip from eight yards out.

At the other end of the table, Malaga were relegated after losing 1-0 to fellow strugglers Levante.

Ghanaian star Emmanuel Boateng scored the only goal in the third minute of injury time to condemn Malaga to the drop.