Buoyed from their Copa del Rey win over Almeria in midweek, Leganes attempted to catch in-form Atleti off guard in the opening minute, with Juan Cruz curling a first-time shot agonisingly wide of Jan Oblak’s right post.
The visitors, who dispatched Elche in their respective cup tie, started to flex their muscles following that early scare, as Julian Alvarez threatened to score in a third consecutive game, only to see his right-foot strike clip the outside of the far post.
The woodwork proved to be the centre of Atleti’s frustration in the first period, with Antoine Griezmann and Conor Gallagher joining Alvarez in striking the frame of Marko Dmitrovic’s goal.
After making it through to the break unscathed, Leganes required just three second-half minutes to take a surprise lead at Butarque.
Former Manchester City defender Nastasic got away from his marker to power a header home from Dani Raba’s out-swinging corner.
Diego Simeone waited just 10 minutes following Nastasic’s first Leganes goal before he introduced Koke and Marcos Llorente from the bench, with the hope that they could help inspire a turnaround.
However, Leganes were in no mood to relinquish their lead without a fight, and they nearly doubled their advantage through Cruz, who fired over the bar after neatly working himself into a promising position in the Atleti box.
The visitors were given a lifeline in the closing stages when the referee pointed to the spot after a VAR review revealed Sergio Gonzalez had handled in the box.
The usually dependable Griezmann assumed responsibility, but he could only drag his spot-kick harmlessly wide to the joy of the majority in attendance at Butarque.
That miss ensured Leganes could celebrate a famous win - to go with December’s victory over Barcelona - that moves them five points clear of danger, while Atleti are at risk of dropping down to second by the end of Matchday 20.

Flashscore Man of the Match: Matija Nastasic (Leganes)