Manchester City, who finished second in Group C, were held to a 1-1 draw at home by Celtic.
Wenger gave his Arsenal side just a 10 per cent chance of advancing top of the group, but that is what happened as rivals Paris St Germain only drew at home to Ludogorets to open the door for the Gunners – and they forced their way through it in freezing conditions.
Arsenal went into the final matchday almost certain of advancing to the round of 16 as runners-up for the fourth straight season, knowing even victory in Switzerland would not be enough if PSG picked up an expected win.
But Perez, with a hat-trick, and Alex Iwobi were on target as Basle surrendered tamely, only striking a late consolation through Seydou Doumbia.
And, remarkably, Ludogorets pulled off a surprise result some 250 miles away in Paris, meaning Arsenal go into Monday’s draw as winners.
Although they could still land the likes of Bayern Munich or Real Madrid, at least Wenger knows he did all he could to avoid the biggest clubs and looks to progress into the quarter-finals for the first time since 2010.
The Frenchman took a strong squad and played the likes of Mesut Ozil and Alexis Sanchez in the clash at a bitterly cold St Jakob Park.
Patrick Roberts scored against his parent club as Celtic held Manchester City to a 1-1 draw in their final Champions League Group C game.
The 19-year-old, on loan to the Scottish champions from City, struck after just four minutes at the Etihad Stadium.
City responded quickly with Kelechi Iheanacho netting an equaliser in what proved a compelling first half, but the pace dropped as the sides went through the motions after the break.
With City already qualified as group runners-up and unable to take top spot, and Celtic destined to finish bottom, that was understandable.
Yet Celtic, who made just the one change compared to City’s nine, started as if determined to treat their final European outing of the season as more than a dead rubber and Roberts pounced on poor distribution from Willy Caballero to slalom into the area and fire past the back-up goalkeeper.
It was a sweet moment for the teenager, who joined City in an £11m deal last year from Championship Fulham, but then moved to Celtic on an 18-month loan in February having barely registered on the first-team radar.
His goal provided the spark for a compelling first half, with City rousing themselves almost immediately.
City equalised just four minutes later as Iheanacho, who looks set for a run in the side with Sergio Aguero due to serve a ban, raced onto a ball from Nolito and rifled home.
The 20-year-old Nigerian might have had a second moments later but shot wide after a break by Pablo Zabaleta, who was impressive in an unfamiliar midfield role.