LONDON • For 79 minutes on Tuesday, this looked like being another case of Manchester City falling short in the Champions League just when opportunity knocked.
Then the game turned in five frenetic minutes late on and, perhaps with it, the prospects of Manuel Pellegrini's team in the competition this season.
With Juventus losing 0-1 away to Sevilla, a 4-2 victory over Borussia Moenchengladbach, inspired by a bewitching second-half performance from Raheem Sterling on his 21st birthday, guaranteed City top spot in group D.
It was the first time in five attempts the club have achieved that feat, and the consequences could be hugely significant.
At the very least, City will be spared another game against Barcelona, their nemesis in the round of 16 in the past two seasons, when the draw for the first knockout stage is made on Monday.
But they will also avoid both Madrid clubs and Bayern Munich.
Given their record of unfavourable draws, Pellegrini may be reluctant to consider this a watershed in City's Champions League history just yet and he will note that a pairing with Paris Saint-Germain is possible. It would be just City's luck to get them, too, would it not?
A collective shambles in the first half, when they trailed 1-2 after goals from Julian Korb and Raffael cancelled out David Silva's strike, City emerged after the interval re-energised and purposeful.
Sterling struck in the 80th and 81st minutes while substitute Wilfried Bony was also on target as the English club ran riot at the end.
With City missing the injured Sergio Aguero and Bony demoted to the bench, Pellegrini used Sterling as a makeshift central striker.
"It is his (Sterling's) birthday, he is 21 years old. The minimum he has to do was score two goals,"Pellegrini joked.
The manager was impressed with the effort of his team, who were outplayed 2-0 by Stoke City last Saturday in the Premier League.
"I think if we play the way we did in the second half we can play against any team," Pellegrini said. "It is better to finish first because you can avoid important teams for one stage more, but if you hope to win the title, you have to play against the big teams."
THE TIMES, LONDON, AGENCE FRANCE-PRESSE