LONDON (AFP) - Olivier Giroud kept Arsenal's Champions League campaign alive as the France striker punished a costly blunder from Bayern Munich goalkeeper Manuel Neuer to inspire a crucial 2-0 win on Tuesday.
Giroud came off the bench to open the scoring after Neuer made a hash of dealing with a free-kick with 13 minutes left at the Emirates Stadium and Mesut Ozil added the killer second with virtually the last kick.
Despite being on the back foot for long periods, Arsene Wenger's side gratefully accepted Neuer's gift after consecutive Group F defeats had left them on the verge of elimination.
The Gunners still have little margin for error with a trip to Munich next up, but their determined display has given them much-needed hope of making the knockout stages for a 16th successive year.
It was an especially ironic twist after a howler from Arsenal goalkeeper David Ospina had played a major role in their loss against Olympiakos in their previous European fixture.
Wenger had made the surprisingly candid revelation that his players underestimated Dinamo Zagreb and Olympiakos in the two defeats that had put them in such a perilous position, but there was never any chance they would repeat that mistake against the Bundesliga leaders.
Alexis Sanchez led Arsenal's first incisive raid as the Chilean surged forward before picking out Ozil for a low shot that Neuer turned away.
Bayern's victory at Werder Bremen on Saturday made them the first team ever to win their opening nine league games.
And the sublime attacking play behind that record-breaking run was on display when Thomas Muller slipped a perfectly weighted pass through to Thiago Alcantara, whose drive was parried away by Petr Cech.
Bayern boss Pep Guardiola had claimed he expected Arsenal to fight like animals, but Wenger's men were caged by the Germans' metronomic passing game for long periods and Sanchez was fortunate to get away with a handball as he blocked a shot.
With the Germans weaving intricate patterns around midfield, Arsenal's concentration wavered when Jerome Boateng was given time and space for a long pass to Douglas Costa.
Costa's quick feint took him past Hector Bellerin with ease and Bayern winger's powerful shot from a tight angle forced Cech to make a good save at his near post.
Bayern's intelligent movement again reduced Arsenal to helpless bystanders when Arturo Vidal finished another flowing move by testing Cech with a dipping strike.
Aware that chances would be at a premium against such elite opposition, Arsenal countered by attacking with pace on the break, but when their chances came Theo Walcott scuffed wide from a good position and Sanchez blazed high into the stands.
Walcott had no reason to reproach himself late in the first half when his seemingly goal-bound close-range header from Nacho Monreal's cross was brilliantly clawed away by Neuer.
It was an outrageously good save and Arsenal's frustration only grew as Aaron Ramsey dragged the rebound across goal.
Costa was a constant menace and the Brazilian lashed just over from long-range soon after the interval.
Robert Lewandowski had scored 15 goals in his last seven appearances for club and country and Bayern's Polish forward nearly added to that tally with a stinging drive that Cech pushed over.
Bayern kept pressing and Lewandowski's shot was repelled by a Laurent Koscielny block, while Muller's angled strike flashed just wide.
But after his earlier heroics, Neuer finished the villain as he gifted Arsenal the lead in the 77th minute.
Santi Cazorla floated a high free-kick into the Bayern area and as Neuer came to collect behind Koscielny he allowed the ball to slip past him to Giroud, who headed against his hand and into the empty net.
Rocked by that stunning setback, Bayern succumbed again in stoppage-time when Bellerin caught them on the break with a blistering run and cross to Ozil, whose first-time shot crossed the line despite Neuer's best efforts.