Atletico Madrid have leapfrogged Real Madrid and moved into third place in La Liga courtesy of a late Thomas Partey goal at Deportivo La Coruna this afternoon.
Diego Simeone's side were unbeaten in the league heading into the encounter but had drawn six of their last seven games in all competitions, while Depor boss Cristobal Parralo was looking to make it two wins from two since replacing Pepe Mel at the Riazor last month.
After a cagey start, Depor midfielder Zakaria Bakkali had the first meaningful attempt of the encounter with 18 minutes on the clock, trying his luck from the left of the box but the shot went wide.
Antoine Griezmann then had an opportunity to give his side the advantage, collecting the ball just a few yards out, but amid a crowded box, his backheel went tamely into the arms of Depor keeper Costel Pantilimon.
At the other end, Guilherme sent a long-range shot wide of the right post before Lucas Perez put in a smart pass to summer arrival Fede Cartabia, whose poor touch sent the ball behind.
As the half wore on, Deportivo were the brighter of the two and had wave after wave of chances, Diego Godin making a string of vital clearances for Atleti.
With the scoreline goalless at the break, Simeone brought on Nicolas Gaitan for Angel Correa and Atletico duly came out of the traps with renewed vigour.
Less than a minute after kickoff, Griezmann produced the game's first shot on target, finding himself close down on the right, but his low effort was well saved by Pantilimon.
Godin was next up, sending his header wide, then Saul Niguez had a shot from just outside the box blocked.
Time and again Depor's stubborn defence thwarted Atleti's creative flair and with over an hour on the clock, the home side grew back into the game, Guilherme again trying his luck from distance but sending the ball over the bar.
With the clock running down, both sides made their final changes, Parralo bringing on Florin Andone for the tired Bakkali and Simeone swapping an unhappy Griezmann for defender Jose Gimenez.
Atletico looked to be heading for their seventh draw in eight games but claimed a shock winner just before the final whistle.
The visitors were handed the lifeline when Sidnei elbowed Lucas Hernandez just outside the D with one minute of regular time remaining, and Partey duly converted with an incisive shot to the right of Pantilimon, who was frozen to the spot.
Andone almost levelled things straight back up in the dying seconds but his low header was well-saved by Miguel Angel Moya as the referee blew the whistle.
Next up for Atletico after the international break is the Madrid derby at the Wanda Metropolitano on November 18, while Deportivo travel to struggling Malaga a day later.
Deportivo (4-2-3-1): Pantilimon; Juanfran, Schar, Sidnei, Luisinho (Navarro 82'); Borges (Mosquera 75'), Guilherme; Fede, Valverde, Bakkali (Andone 75'); Perez
Atletico (4-4-2): Oblak; Juanfran, Savic, Godin, M Gomez; Thomas, G Fernandez, A Fernandez (Gameiro 61'), Niguez; Correa (Gaitan 45'), Griezmann (Gimenez 80')