Manchester City came back from 2-0 down to pull off a remarkable 3-2 victory at Bayern Munich, but it was not quite enough to see the Blues leapfrog their hosts into top spot in Champions League Group D.
Both sides had already qualified for the knockout stage before this match, which was their concluding Group D fixture, and for second-placed City to overhaul defending champions Bayern and secure first position, it required them to win here with a better scoreline than 3-1 - that by which the German outfit beat them at the Etihad Stadium.
It appeared an unlikely prospect before and a virtual impossibility soon after kick-off as Bayern ripped through a helpless-looking City defence and raced into a 2-0 lead, with Thomas Muller striking in the fifth minute and Mario Gotze in the 12th.
Three minutes later the visitors had to substitute Micah Richards for Pablo Zabaleta, but their fortunes improved considerably from there as the game went on.
Having steadied the ship, City hit back through David Silva's close-range finish in the 28th minute and they then scored two second-half goals in quick succession to complete an incredible turnaround, with Aleksandar Kolarov converting a 59th-minute penalty before James Milner's cool finish three minutes later.
And while it was ultimately not sufficient for the Blues to take top spot, they have certainly made a statement about their credentials ahead of the next phase.
Boss Manuel Pellegrini had made it clear pre-match that, at the very least, he wanted a considerable improvement from City on their display in the initial meeting, in which they were completely outplayed by Bayern for much of the contest.
It looked in the early stages as if the Blues were set for an even more chastening experience but overall City delivered the kind of thing their manager had been looking for - and they might have even scored a further goal that would have sent them top if Manuel Neuer had not been alert to stop substitute Alvaro Negredo late on.
Pellegrini had also admitted in the build-up to the match that he was preparing for it with Saturday's Barclays Premier League home clash against table-toppers Arsenal also in mind, and his team selection reflected that.
The Blues' first XI showed seven changes from last weekend's draw at Southampton, with Joe Hart, Richards, Joleon Lescott, Javi Garcia, Jesus Navas, Edin Dzeko and the fit-again Silva being brought into it and the likes of Vincent Kompany, Zabaleta, Sergio Aguero, Negredo and Samir Nasri dropping out - the first four to the bench - as well as the suspended Yaya Toure.
For Bayern, meanwhile, there were just two alterations from their 7-0 win at Werder Bremen, and their potency was soon evident.
Hart, making only his second appearance in 10 City games, had already endured a nervy moment due to a miscued attempted backpass from Lescott when Muller put Bayern 1-0 up.
The forward chested down a lofted delivery from Dante, got the better of City's skipper-for-the-night Kolarov and fired past the England goalkeeper.
Hart got down to save a Dante header four minutes later, and then diverted the ball, struck by Franck Ribery, against the post, but it was not long before he was beaten again as Bayern kept up the heat.
City made a hash of trying to deal with a corner and the ball ricocheted via Mario Mandzukic's shot to the feet of Gotze, who converted from six yards out.
Richards limped off for Zabaleta soon after and there was further Bayern pressure to weather, with Ribery's shot being blocked and Hart denying Toni Kroos.
But then Fernandinho fired off-target at the other end and with City having settled down, Silva - back after six games out due to a calf problem - hooked in to make it 2-1, connecting with a Milner header from Navas' cross.
Navas put the ball into the side-netting within moments and it was a fairly even contest for the rest of the first half, although there were a couple of warnings from the hosts, with Hart having to come out to keep Gotze at bay and City's ex-Bayern man Martin Demichelis getting in the way of a Muller shot.
City made a solid opening to the second half and after Dzeko had called Neuer into action, Dante brought down Milner in the area and the penalty was awarded.
Kolarov made no mistake from the spot and then City were in front as Milner swept in a Navas cross which former Blues defender Jerome Boateng attempted to hack away but completely missed.
City kept pushing and sloppiness from Dante allowed Negredo the opportunity to make it 4-2 with 11 minutes to go, but Neuer saved.
Milner hails City spirit
James Milner believes Manchester City showed they have the qualities to progress deep into the Champions League knock-out stages after rallying to beat holders Bayern Munich 3-2 at the Allianz Arena.
Bayern jumped into a 2-0 lead through Thomas Muller and Mario Gotze inside the first 12 minutes.
David Silva pulled a goal back before half-time before an Aleksandar Kolarov penalty and Milner's 62nd-minute strike completed an unlikely comeback.
While City were unable to push on for another goal which would have seen them displace Bayern at the top of the group, Milner said the performance revealed they have the quality and desire to make an impact in the knock-out stages.
"It says a lot about the dressing-room and the character of the players," he told Sky Sports 2.
"It was a terrible start and we gave away some sloppy goals.
"But to go to a place like this and go 2-0 down and then come back and win shows the character in this dressing-room.
"It was not enough to win the group but it shows the type of performance we need in the next round. We can come to a place like this and score goals.
"We wanted a bit of revenge after the first game (which City lost 3-1). It will give us a lot of belief. We will come up against a good team like Bayern (in the next round)."