The Blues took an early lead through Sergio Aguero’s 24th goal of the campaign and seemed to be coasting towards victory until the hosts struck back with two penalties before the break.
But despite losing Nicolas Otamendi for a second bookable foul midway through the second period, City fought back magnificently with two late goals – the first a stunning free-kick from Leroy Sane and the winner on 90 minutes a clever finish from Raheem Sterling.
With the VELTINS-Arena packed and a partisan home crowd in great voice, the scene was set for a memorable evening of European football.
City’s first attempt on goal was an intricate set-piece that ended with David Silva crossing and Sergio Aguero seeing a header tipped over by Ralf Fährmann.
In fact, there was a veritable feast of free-kick and corner variations in the first 15 minutes, but the Blues’ opening goal was down to good old-fashioned anticipation and reading of the game.
As Schalke worked the ball back to their keeper, Silva was quicker to react to Fährmann's short pass to the edge of the box, stole in and slipped the ball to Aguero who made no mistake from six yards.
There was a minute or so before the goal was confirmed by VAR – but the next time it would be used it would be the Blues who suffered.
The next major talking point didn’t come until the 33rd-minute when a shot from the edge of the box by Daniel Caligiuri was deflected around the post by Otamendi.
The Schalke players immediately claimed handball, the decision was referred to VAR and after a five-minute delay, the referee awarded a penalty.
The unclear handball rules meant it was difficult to understand how a player who tried to move his arm behind his body to avoid the ball could be penalised - but the fact the referee couldn't review the incident himself because of technical issues didn't help matters.
Otamendi was booked and as a result, misses the return leg and Nabil Bentaleb sent Ederson the wrong way to level the scores.
But if that seemed harsh, on the stroke of half-time the referee awarded a second penalty for the Germans as Fernandinho was judged to have pulled down Salif Sane as a free-kick was lofted into the box.
It again was harsh on the Blues with Sane seeming to have been marginally offside, and more so as Bentaleb again beat Ederson from the spot and the booking Fernandinho received as a result means he will also be banned for the return leg.
What had been thus far a very comfortable evening had been turned on its head in the space of 10 controversial minutes with City losing two goals and two players for the second leg.
City started the second period with Kevin De Bruyne whistling a low shot a foot wide and then a smart move between Silva and Aguero was only denied by a fine Matija Nastasic tackle as Kun was about to pull the trigger.
But Schalke were resolute and organised and the Blues were struggling to get their through their defensive ranks.
Things got worse for City on 68 minutes when Otamendi was booked for the second time for a foul on Burgstaller and sent for an early bath, reducing the Blues to ten men for the last 20 minutes or so.
But instead of Schalke tightening their grip on the game, the Blues fought back magnificently.
Sub Leroy Sane levelled the scores on 84 minutes with a blistering 25-yard free-kick to silence the home fans and seemingly give City a priceless draw – but there was more to come.
Ederson – is there a better goalkeeper in world football? – passed the ball fully 70 yards into the path of Sterling who held off his marker before slotting home with a clever shot past Fährmann.
It was a breathless finish from a team who never know when they’re beaten, and it gives City a fantastic chance of progressing to the last eight of the competition – though on this evidence there is still plenty of hard work to do.
What it means…
City have three away goals and a 3-2 aggregate advantage to take back to the Etihad next month.
But the Blues will definitely be without the suspended Otamendi and Fernandinho.
Star man: Bernardo Silva
Non-stop action (as usual) from the Portuguese playmaker.
"To go away and score three goals, plus the way we started; the way we finished, the way we reacted at half time... so I am more than delighted with this win.
"But it’s not enough in this competition. We gave them first goal, we gave them the second and the red card.
"We need to improve. We are a nice team to watch. I don't know how far we can get, but we are nice to watch. I know because I was living here, and I remember as a player, how difficult it is to play in Germany.
"Always it’s tough. We gave them opportunities to be in the game and we have to improve."
It’s the small matter of the Carabao Cup final up next for the Blues with a Sunday Wembley date against Chelsea.
Then, City take on West Ham United at the Etihad next Wednesday in the Premier League.