Olivier Giroud gave Arsenal and early lead in the third minute and Laurent Koscielny added the second in the 86th but Arsenal remained one goal away from erasing its 3-1 deficit from the first leg.
"Our second goal came a bit too late," Arsenal manager Arsene Wenger said. "Bayern was nervous but we paid the price for not playing well in the first leg."
With the series level 3-3 on aggregate, Bayern advanced to the quarterfinals on the away goals rule.
"It wasn't our plan to concede such an early goal," Bayern coach Jupp Heynckes said. "Our second half was better, but we did not really control the game, we were not calm."
Bayern is a four-time winner of the competition and was runner-up twice in the last three seasons. It reached the last eight for the 12th time. With Borussia Dortmund also in the quarterfinals, Germany has two sides in the last eight for the first time in 11 years.
With Manchester United, Manchester City and Chelsea all having been eliminated already, England is without a team in the quarterfinals for the first time since 1996. The loss also ensured that Arsenal will finish without a trophy for the eighth straight season.
In the second match Wednesday, Malaga beat Porto 2-0 to reach the last eight 2-1 on aggregate.
Arsenal's players had said before the game they needed a "miracle" to advance, and after the early goal it looked like they might just get one.
Tomas Rosicky fed Theo Walcott on the right and the winger found space when David Alaba slipped on the wet grass. Walcott raced into the penalty area and sent a hard, low ball through the legs of Dante and across the goal for Giroud to drive it into the roof of the net from a couple of meters (yards) out.
That made for a nervous evening for the home crowd, although Bayern gradually took control of the game and didn't allow any more dangerous chances for the rest of the half. The hosts then dominated much of the second half but were limited mostly to long-range attempts.
Shots from Arjen Robben, Toni Kroos and Luiz Gustavo narrowly missed Arsenal's goal and the best chance for Bayern came when Thomas Mueller sent a through ball with his heel for Robben, who raced alone toward the goal but was foiled by goalkeeper Lukasz Fabianski in the 68th.
Arsenal had only one real chance before its second goal, when substitute Gervinho rolled the ball past Manuel Neuer but also wide of the post.
Arsenal then added more suspense into the match by netting the second.
Santi Cazorla sent in a corner and Koscielny beat Javi Martinez to the header and sent the ball low inside the right post.
Arsenal couldn't seriously threaten again, though, as Bayern hung on to its edge from the first leg.
"It shouldn't have been that close," Robben said. "We talked about it before the match. Arsenal had nothing to lose and we were not aggressive enough. Maybe it was a wake-up call. We conceded an early goal and there were still eight minutes to play after their second, we knew we were close to letting it slip away."
Bayern remains on course for three trophies. It is 20 points ahead in the Bundesliga and is also in the semifinals of the German Cup.