Kevin De Bruyne had given City a first-half lead against an enterprising Borussia Dortmund, but failure to convert a couple of very good opportunities eventually proved costly as Marco Reus levelled five minutes from time.
But the excellent Foden had the final say, as De Bruyne’s peach of a cross into the box was cushioned into Foden’s path by Ilkay Gundogan and the young England star made no mistake with an angled low shot.
City played with patience and purpose, feeling out Dortmund in a cagey opening.
Indeed, Ederson was called upon first after just seven minutes when he made a save from Jude Bellingham, before City gradually started to take control.
Though Dortmund had been well organised, they were masters of their own downfall when City finally went ahead on 19 minutes.
Riyad Mahrez intercepted a poor pass from Emre Can, played it to De Bruyne who drove forward towards the Dortmund box and played it to Phil Foden who’s cross from the left to Riyad Mahrez was slightly overhit – but Mahrez kept the ball in play and laid it back to De Bruyne who fired a low shot past the keeper from close range.
Ten minutes later and it looked as though City would have a golden chance to double the lead.
Rodrigo went down in a heap under a challenge from Can in the box and on first glance, it looked as though the German had caught the City midfielder in the face – the referee felt the same as he pointed to the spot but after a lengthy VAR inquest, the official reviewed his decision on a pitch side monitor before reversing his decision.
Was it a penalty? Probably not, but it was another example of how City’s poor luck with VAR decisions in the Champions League continues – though moments later there was relief that there wasn’t a VAR review as Ederson was caught in possession outside his box by Bellingham and the former Birmingham City player went on and rolled the ball into the empty net.
The referee had already blown for a foul, but TV replays suggested there had been minimal contact and Ederson was a shade lucky to get away with it.
The end result was City took a 1-0 lead in at the break.
If Ederson was at fault for the Bellingham incident, he came to the rescue on 48 minutes as the powerful Erling Haaland just edged a physical battle with Ruben Dias as he chased a through ball and the Norwegian’s shot was well saved by the City No.1.
It was the first glimpse of what the 20 year-old is capable of and a reminder for the City players to keep the supply lines firmly closed.
City came close to doubling the lead on 64 minutes after a great break on the right by De Bruyne and as he raced into the box he picked out Foden who hit a low shot straight at Dortmund keeper Hitz and the German side survived.
De Bruyne and Foden were causing Dortmund problems all night and both went close within the space of a minute on 76 with the Belgian whistling a low shot a foot wide before setting up Foden who hit a low drive straight at the keeper.
City paid for the missed chances on 84 minutes when Haaland’s flick sent Marco Reus clear on the edge of the box and the Dortmund midfielder tucked the ball past Ederson to give the Germans a crucial away goal.
But Foden’s late strike gives City the advantage going into next week’s second leg.
Mature UCL performance by City
There was an air of calm about City throughout this first leg tie.
In previous years we’ve seen the franticness of a first leg loss against Liverpool, drama and heartache against Spurs and an off-colour display against Lyon last summer.
But there was no panic or adrenaline-filled passages of play against Dortmund – just a confident display from a side who controlled much of the play and took no chances.
Yes, Dortmund finally found a way through – with their strike force it is no major surprise – but City hit back almost straight away.
No panic, just calm and focus throughout – hallmarks of the sides who have enjoyed success in this competition down the years.
The second leg will be equally challenging, but this is our first victory in a Champions League first leg at the fifth attempt.
Mesmeric display by our box-of-tricks magician.
And on a night when arguably the eyes of many were on a 20 year-old in yellow and black, it was a 20 year-old in sky blue who stole the headlines.
WHAT IT MEANS...
City take a 2-1 lead into the second leg knowing a draw would be enough to secure a semi-final spot - if Dortmund score, City must also score to have any chance of progression.
City resume Premier League duty on Saturday lunchtime as we host Leeds United at the Etihad (kick-off 12.30pm).
Then it's over to Germany for the second leg against Dortmund a week on Wednesday (8pm kick-off).
"It is better to win than draw.
"In the first half we were not clever with the ball.
"Our pass was not good for the team-mate, but the second half was much better and we had two, three clear chances at 1-0 to score the second and third,
"Unfortunately it didn’t happen. But then we found the winning goal.
"To play good in the areas we want you need to make a good build up and today was not good.
"Joao and Rodri were not clever to receive the ball. But it is normal. Dortmund is strong with good quality.
"With the pace and quality upfront they have it is hard to do what we want to do., but 2-1 is good and we have another chance in one week.
"We are going to watch the game. Now we know exactly what they do. We will adjust a few things to try to go there and win the game. We have won 27 in 28 and now Leeds.
"And then we go to Germany to try to win the game."
Dortmund: Hitz, Morey,Akanji, Hummels, Guerreiro, Bellingham, Can, Dahoud (Delaney 81), Knauff (Reyna 63), Haaland, Reus
Subs: Bürki, T Hazard, Schulz, Brandt, Carvalho, Meunier, Piszczek, Tigges, Passlack, Drljaca
STATS & FACTS
Aged 20 years and 313 days, Phil Foden is the youngest Englishman to score a 90th-minute winning goal in a Champions League match, overtaking Wayne Rooney who was 21 years and 182 days when he scored the winner for Manchester United in a 3-2 win over AC Milan in April 2007.
Since their first season in the Champions League in 2011-12, no team has more 90th-minute goals than Manchester City (17, level with Real Madrid).
Marcos Reus is now Borussia Dortmund's outright top scorer in the Champions League with 18 goals. He was previously tied on 17 with Robert Lewandowski.
Reus is also the first player to score a Champions League goal against Man City since Luis Diaz for Porto in October, ending City's run of 788 minutes without conceding in the competition (seven consecutive clean sheets before today).
City have now won 27 of the last 28 matches in all competitions.
City are on a seven-game winning run, home and away, against German clubs – including this season's round of 16. Our win over Dortmund was our seventh successive home victory against Bundesliga teams; a 3-1 defeat by Bayern in 2013 (managed by Guardiola) is our sole loss to German opposition in Manchester (W9 D2).
City have scored 54 goals in our last 22 UEFA Champions League matches; over the last three seasons, our record is W21 D4 L3 with 70 goals scored and 23 conceded.
Guardiola's team are unbeaten in 13 home European matches (W12 D1) since a 2-1 loss against Lyon on Matchday 1 in 2018/19.
News about Man City v Borussia Dortmund
Guardiola praises ‘incredible commitment and desire’ of his players
Pep Guardiola congratulated his players for the “incredible commitment and desire” they showed to beat German side Borussia Dortmund 2-1 in the first leg our Champions League quarter-final. Watch more.
De Bruyne praises City's reaction against Dortmund
Kevin De Bruyne has hailed City's reaction to conceding an equaliser against Borussia Dortmund as Phil Foden netted a late winner in the Champions League quarter final first leg. Read more.
Gallery: Foden strike earns first-leg advantage
Kevin De Bruyne and Phil Foden netted for City in a pulsating 2-1 Champions League quarter final first leg victory over Borussia Dortmund at the Etihad Stadium. View more.
Foden lauds 'special' De Bruyne
Phil Foden has applauded the magnificence of Kevin De Bruyne after the Belgian starred during the 2-1 Champions League first leg victory over Borussia Dortmund. Watch more.
City 2-1 Dortmund: Full-Match replay
Watch the full 90 minutes of City’s thrilling Champions League quarter-final first leg triumph over Borussia Dortmund with a CITY+ subscription. Watch more.
City 2-1 Dortmund: Match highlights
The best of our first leg win at the Etihad... Watch more.
Dickov heaps praise on team player Rodrigo
Paul Dickov has highlighted the crucial role that Rodrigo plays in our defensive setup as well as his ‘outstanding’ football intelligence. Read more.
Guardiola: 'We go to Dortmund aiming to win'
Pep Guardiola praised his players for remaining calm after Dortmund scored and responding with the goal that gives City a 2-1 lead in the quarter-final first leg. Read more.