A late Mesut Ozil strike saw Arsenal come from two goals down to beat Ludogorets and book a place in the round of 16 of the Champions League.
With Group A rivals Paris Saint-Germain beating Basel in Switzerland, a win would see the Gunners through with two games to spare -- and Ozil popped up to complete a 3-2 win with three minutes remaining.
That had looked improbable as the Gunners made a shaky start to proceedings at the Vasil Levski National Stadium in Sofia.
Ludogorets were two goals ahead inside the opening 15 minutes as Jonathan Cafu and Claudiu Keseru struck -- but a first Champions League goal for Granit Xhaka and a header from Olivier Giroud before the break had Arsenal level before Ozil's late heroics secured qualification from the opening group stage for a 17th consecutive season.
Manager Arsene Wenger said on the eve of the game that it was Arsenal's "prime target'' to top Group A in the hope of avoiding a tricky tie in the round of 16 stage -- where the Gunners have been knocked out in the past six seasons.
And the Frenchman showed that intent by selecting arguably the strongest side at his disposal, despite the fact that Arsenal face a crunch North London derby at home to Tottenham on Sunday.
Ozil, Laurent Koscielny and Alexis Sanchez were retained, although the latter was shifted onto the left flank to accommodate Giroud -- making his first start of the season after scoring twice in Saturday's win at Sunderland.
Ludogorets, thrashed 6-0 at the Emirates Stadium a fortnight ago, changed their goalkeeper and centre-forward as Bulgarian striker Keseru came in after hitting a hat trick in their last league outing.
Ozil helped himself to three goals when these sides met last time, and had a decent chance to open the scoring only to produce a tame shot from Francis Coquelin's threaded ball.
And it was the Bulgarian champions who took the lead as Cafu finished from close range after Arsenal failed to clear a Wanderson free kick into the area.
The second came shortly afterwards as Kieran Gibbs was beaten by Cafu too easily down the right and Keseru converted his cross.
Arsenal responded well and were back in the contest as Xhaka swept home Ozil's pass from the touchline.
While Ludogorets still posed a threat on the counter-attack, Arsenal were getting back to near their recent best and were level three minutes before the interval as Giroud headed home Aaron Ramsey's cross at the near post.
The second half started evenly but without many chances for either side until Wanderson was played in behind just after the hour mark, only for the Brazilian to shoot weakly at David Ospina.
Mohamed Elneny came on late in the contest and played in Ozil, who showed great composure to round the goalkeeper and two defenders before slotting home to seal Arsenal's spot in the last 16.