The Citizens were seemingly on course to reach the showpiece event in Paris when Riyad Mahrez opened the scoring at the Santiago Bernabeu with a trademark left-footed strike in the 73rd minute.
With Los Blancos trailing by two goals on aggregate, the pressure was on for them to breach City's backline, but they struggled to carve out any clear cut chances to test Ederson between the sticks.
Although the hosts were unable to register a single shot on target in the first 89 minutes of the contest, City were stunned by two injury-time goals from substitute Rodrygo.
Karim Benzema set up Rodrygo for a close-range tap in to level the score on the night, shortly before Dani Carvajal curled an inviting cross towards the Brazilian, who headed past Ederson to turn the second leg on its head in dramatic fashion and send the tie into extra time.
Just a minute before Rodrygo had scored his first, substitute Jack Grealish came agonisingly close to sealing victory for Pep Guardiola's side, but his initial strike from a tight angle was cleared off the line by Eder Militao before the left boot of Thibaut Courtois kept out the Englishman for a second time just seconds later.
The momentum was certainly with Real Madrid heading into the additional 30 minutes, with City looking both physically and mentally drained, while Los Blancos were riding on an adrenaline wave provided by their raucous home supporters.
Just five minutes into extra time, the hosts were awarded a penalty when Ruben Dias caught Benzema inside the area, and the Frenchman calmly slotted the resulting spot kick into the bottom-right corner, putting Los Blancos in front on aggregate for the first time and sending the Bernabeu into pandemonium.
To the frustration of the Citizens, only three minutes of added time were awarded despite a plethora of stoppages and substitutions towards the end of extra time, but nevertheless, City endured yet another heart-breaking exit from the Champions League, this time at the hands of 13-time winners Real Madrid.
Los Blancos now have the small matter of the Madrid derby against rivals Atletico Madrid to prepare for on Sunday, while Man City will turn their attention to the Premier League title race with a home encounter against Newcastle United.
body check tags ::