Caroline Weir came back to haunt her former club at the Estadio Alfredo Di Stefano with the only goal of the game early in the first half.
But it wasn’t to be, meaning City’s European journey ends in qualification at the hands of the side who also knocked us out of the competition last season.
Despite the pressurised environment generated by a vocal crowd of 2,811, City enjoyed the majority of the early play, looking confident in possession and tenacious when out of it.
But it was the hosts who carved out the first real sight of goal at the Estadio Alfredo Di Stefano when Naomie Feller’s close-range strike was deflected behind at the last second.
And City were thankful to Ellie Roebuck for a fantastic reaction save from the resultant corner, the stopper tipping a ferocious half-volley from Olga Garcia Carmona around the post when the effort looked destined for the top corner.
Those two chances in quick succession sprung Las Blancas to life, and they took the lead just before the 15-minute mark through a familiar face.
After winning possession back on the high press, Weir picked up play from Esther Gonzalez with her back to goal, rolling away from the close attentions of Aleixandri before smashing a vicious drive past Roebuck.
City rallied despite the setback, with Aleixandri’s header from a Chloe Kelly corner bouncing agonisingly over the bar from close-range soon after.
But the hosts continued to threaten, particularly from set piece situations, and were guilty of squandering a glorious opportunity to double their advantage as half-time approached.
Another looping cross in from Carmona found Ivana at the back post, but her ball back across goal to centre-back partner Kethellen was somehow headed onto the top of the bar from less than six yards.
City continued to weather the storm, but there was still time for one more opportunity before the break when an exquisite late challenge from Alex Greenwood thwarted Feller as she shaped to pull the trigger inside the area.
Having grabbed an early brace against WFC Tomiris-Turan, Bunny had been frustrated by Madrid’s stubborn defence in the first 45, but the Jamaican showed her quality by almost pulling off a spectacular solo effort soon after the restart.
Turning expertly away from her marker, the forward launched an instinctive volley towards goal which was parried away by Misa in the Madrid net.
A captivating encounter continued to ebb and flow, with Roebuck down well to her right to tip Weir’s volley past her near post, but City continued to grow back into the contest.
It was Laura Coombs’ turn to go close next, firing just over the bar after great work from fellow substitute Hayley Raso down the right, before the Australian’s cross into Aleixandri soon after was glanced just wide of the far post.
The lively Raso was inches from getting on the scoresheet when she hooked a volley towards goal on the back of a darting near post run, but her effort whistled just wide.
Time was running out, but City continued to knock on the door with Castellanos’ effort across goal striking the far post before the offside flag was raised.
But as Gareth Taylor's side pushed forward in search of the elusive equaliser, the hosts almost caught us with a sucker punch, but Esther's deflected effort could only find the crossbar, rather than the net.
The Madrid forward was denied once again as stoppage time approached, Roebuck coming out on top when sent through one on one.
But there was still time for one last City chance, with Hemp's vicious drive across goal flashing agonisingly wide of the far post after a sustained period of pressure.
It was harsh on Gareth Taylor's side, whose tireless efforts in the Madrid heat could well have been rewarded on another day.
How we lined up
Gareth Taylor made two changes from the side who beat WFC Tomiris-Turan 6-0 on Thursday, with Kerstin Casparij and Coombs making way for Esme Morgan - her first competitive start since recovering from a lower leg fracture last September - and Vicky Losada respectively.
Up front, Shaw started through the middle with Kelly and Lauren Hemp providing width on the flanks.
City XI: Roebuck, Morgan, Aleixandri (Houghton 73’), Greenwood, Ouahabi (Stokes 45’), Walsh, Fowler, Losada (Coombs 45’), Kelly (Raso 50’), Shaw (Castellanos 68’), Hemp.
Subs: MacIver, Keating, Casparij, Houghton, Angeldahl, Raso, Kennedy, Blakstad.
Real Madrid XI: Misa, K. Robles (Lucia 74’), Kathellen, Zornoza, Olga, Toletti, Zornoza, Weir (Teresa 86'), Feller (M. Oroz 79’), Esther, Athenea
Subs: Gerard, Sofia, Teresa, Rocio, Nahikari, Claudia F., Moller, Svava, C. Camacho, Paula Partido.
What it means
City's hopes of reaching the Champions League group stages are now over.
It means Gareth Taylor's side now enter the group stages of the Continental Cup, a competition in which we are the current holders.
With the latest round of qualifiers for the 2023 World Cup on the horizon, City’s next fixture is our Barclays Women’s Super League curtain-raiser against Arsenal.
We welcome the Gunners to the Academy Stadium on Sunday 11 September, with kick-off scheduled for 19:00 (UK).
Tickets are selling fast, secure yours here.
News about Man City v Real Madrid
Taylor: My players gave everything
Gareth Taylor says he couldn’t fault the efforts of his players despite the disappointment of losing to Real Madrid in the UEFA Women’s Champions League. Watch more
Champions League setback won’t alter domestic ambitions, says Taylor
Gareth Taylor insists that City’s desire for silverware remains the same despite the setback of a Champions League exit to Real Madrid. Read more
Full Match Replay: City v Real Madrid
Watch every moment from our UEFA Women's Champions League clash against Real Madrid on CITY+ and Recast … Watch more
City 0-1 Real Madrid: UEFA Women's Champions League Highlights
The best of the action from City’s narrow defeat against Real Madrid in the UEFA Women’s Champions League. Watch more