Manchester City have scored three times in the final 12 minutes to come from 2-1 down against Borussia Monchengladbach and win 4-2 at the Etihad Stadium to ensure that they finished top of Champions League Group D ahead of Juventus.
City, already through to the last 16, knew that victory would see them top the group if Juventus failed to beat Sevilla, but their susceptibility in defence was on show in the opening minutes as Fabian Johnson fired over before Julian Korb wasted a good opportunity when he was played onside by Nicolas Otamendi.
However, it was the hosts who took the lead in style somewhat against the run of play after a quarter of an hour when a fine move down the left flank resulted in Raheem Sterling cleverly back-heeling into the path of David Silva, who took a touch and smashed home from a tight angle.
If the home fans thought that goal would put their side in control, however, they were proved wrong within three minutes as Johnson tore through the City defence and squared for Korb to lash a half-volley past Joe Hart and restore parity almost instantly.
Manuel Pellegrini's side were wide open at the back, and Hart was relieved to see no Borussia player on hand to turn home Oscar Wendt's ball across goal, before Sterling fired over the bar as the hosts looked to wrestle the initiative from the visitors.
City had an opportunity to take the lead when Aleksandar Kolarov drilled into the side-netting, but with three minutes left before the break the German side completed the first-half turnaround when Lars Stindl helped on Wendt's cross for Raffael to convert a simple finish from close range.
The home side regrouped at the interval and came out stronger in the second half but could not make the most of early chances as Kevin De Bruyne's effort was deflected over before Sterling just failed to capitalise on an error by Nico Elvedi when he was denied by Sommer.
Silva and Sterling then both shot straight at the goalkeeper from distance as Pellegrini's side continued to hunt a leveller, before Sommer produced a fine stop to keep out Sterling's deflected bouncing volley at the back post as City threw everything at 'Gladbach.
They finally found a deserved equaliser 12 minutes from time when Wilfried Bony could not convert Gael Clichy's cross but Sterling was on hand to steer the ball past Sommer, and less than two minutes later City completed their own comeback.
Sterling capped a lively individual display by curling beyond the reach of Sommer after the hosts had carved open the visitors, and there was even time for Bony to add to the late drama by firing home at the second attempt as City leapfrogged Juventus to win Group D.