Having beaten Arsenal 3-1 at the Emirates Stadium in the first leg in London three weeks ago, Bayern had been odds on favourites to finish the Gunners off in the Bavarian capital to go into Friday's quarter-final draw.
But Arsenal took the fight to their German hosts with striker Olivier Giroud giving the Gunners an early lead before centre-back Laurent Koscielny netted with 86 minutes gone to set up a frantic finish.
Bayern held on and the 3-3 aggregate score saw them sneak through.
"We went close, I am very proud of the performance of the team," said Arsenal manager Arsene Wenger.
"I am disappointed for everyone who supports Arsenal that we couldn't get that third goal.
"Qualifying is over 180 minutes and we weren't at our best in the first 90 minutes."
Much had been made in the build-up of Arsenal's "Mission Impossible in Munich" with the Gunners needing three goals at Bayern's fortress-like Allianz Arena, but the guests quickly dismissed any notion this tie was already decided.
"We hadn't reckoned on conceding an early goal and we allowed them to get into the game," admitted veteran Bayern coach Jupp Heynckes.
"We didn't control the game and weren't calm. They gave us a bit of a black eye tonight."
The game was just three minutes old when Tomas Rosicky found space, Theo Walcott fired in a cross and Giroud drilled his shot into the roof of the net, seized the ball and sprinted back to the halfway line.
It was the first time Bayern had conceded a goal inside the first 15 minutes this season and there were plenty of blank expressions in the Munich ranks.
Bayern responded by playing predominantly in Arsenal's half, but Rosicky, who took the place of the injured Jack Wilshere behind Giroud, was at the centre of everything the Gunners did with the hosts clearly rattled by the opening goal.
The patience and composure which has left Heynckes' side 20 points clear in the Bundesliga suddenly seemed to desert them.
Bayern began the second half with intent as both Arjen Robben and Toni Kroos fired wide, while Thomas Mueller twice forced Arsenal goalkeeper Lukasz Fabianski into diving saves.
Munich controlled possession, but poor final passes kept offering Arsenal some hope with Bayern missing injured France star Franck Ribery on the left wing while suspension meant Bastian Schweinsteiger was absent in midfield.
Robben let a golden chance go begging with 67 minutes gone when he got in behind the Arsenal defence, but he fired straight at Fabianski.
With 10 minutes left, substitute Gervinho came perilously close to adding Arsenal's second, but the ball harmlessly rolled out of play for a goal-kick.
The second goal finally came when Santi Cazorla's corner fell to Koscielny, who beat Bayern's Javi Martinez to head into the bottom right corner.
There was plenty of pushing and shoving in the Bayern goal when goalkeeper Manuel Neuer briefly laid on the ball to eat up a few seconds with the Arsenal players desperate to kick-off again, but the all-important third goal ultimately eluded them.
This is the third time in three seasons Arsenal have exited after the Round of 16 in the Champions League, while Bayern join Bundesliga rivals Borussia Dortmund in the last eight.
What the stars mean:
★ Poor ★ ★ Promising ★★★ Good ★★★★ Very good ★★★★★ Exceptional