Olivier Giroud netted a hat-trick to propel Arsenal to a 3-0 win at Olympiakos on Wednesday and send the Gunners through to the Champions League knockout stages at the expense of the Greeks.
The France striker gave Arsenal a first-half lead at the Karaiskakis Stadium in Piraeus before netting twice more, the third coming from the penalty spot, to ensure Arsene Wenger's side reached the last 16 of the competition for the 16th year in a row.
"I told you before that it would be the greatest escape," Wenger told BT Sport, referring to successive defeats to Dinamo Zagreb and Olympiakos to start the group that had put Gunners in a perilous position.
"I must say I'm very proud of the team as we had to be right on the mental and tactical side. At 2-0 we had to push for a third goal, it was too dangerous to stay at 2-0.
"Nine times out of 10 you are out (after such a poor start to the group). We needed something special to come back like we did and tonight we needed a complete team performance," added Wenger.
Arsenal progressed as runners-up in Group F behind Bayern Munich, who rounded out their campaign with a 2-0 victory away to Dinamo Zagreb in Croatia.
Despite their terrible start to the competition Arsenal arrived in Greece with their fate in their own hands, needing to overturn the 3-2 defeat they suffered against Olympiakos in London back in September.
Theo Walcott, who made an appearance off the bench in Saturday's 3-1 victory at home to Sunderland in the Premier League, made his first start since injuring his calf at the end of October, coming in for Alex Oxlade-Chamberlain.
Colombian striker Felipe Pardo, who scored the opener at the Emirates in the first meeting, gave the visitors an early scare as he fired just over on 20 minutes.
Mathieu Flamini went even closer for the Gunners five minutes later when he drove a shot against the crossbar, with his effort taking a slight deflection off Manuel Da Costa.
But Giroud made the crucial breakthrough on 29 minutes, heading home Aaron Ramsey's cross after some suspect goalkeeping from Roberto, who allowed the ball to creep in at the near post after initially getting a strong hand to it.
There was cause for concern as Giroud went down clutching his right ankle just after half-time, but any injury fears were allayed as the Frenchman struck again shortly after to double Arsenal's lead on 49 minutes.
Costa Rica international Joel Campbell, who spent the 2013-14 season on loan at Olympiakos, wriggled away from two defenders inside the box before sliding a superb pass into the path of Giroud who swept low past Roberto.
Despite their two-goal lead the Gunners knew that were the Greeks to pull one back then the home side would reclaim the upper hand.
However Walcott nearly gave Wenger's men further breathing space just before the hour, only for his volley to brush Arthur Masuaku and flash wide of the post.
Petr Cech then made a smart save to tip over Kostas Fortounis' long-range attempt before Arsenal grabbed a third on 67 minutes to ease the nerves.
Omar Elabdellaoui tried to make a sliding intervention to block Nacho Monreal's goalbound shot, but the ball instead struck the Norwegian's outstretched arm and Giroud calmly tucked away the resultant spot-kick to seal his hat-trick.