Inter, who also beat Bayern in last year's final, were on the brink of going out until Macedonian Pandev struck to put the Italians through on the away goals rule after losing 1-0 in the first leg last month.
Coach Leonardo's team became only the second side to advance in the competition after having lost the first leg at home.
The only other team to achieve that feat was Ajax Amsterdam in 1995-96 when they were coached by Louis van Gaal, now in charge at Bayern.
"To advance like that is just unbelievable. For Pandev to score such an amazing goal, a goal that will go down in history, is just incredible," Leonardo told reporters.
"We showed amazing team spirit today, we showed emotional and tactical intelligence," said the 41-year-old.
LIVE:Our interactive coverage as it happened
Inter made a dream start with a fourth-minute goal from Cameroon striker Samuel Eto'o, his eighth in this season's competition cancelling out Bayern's 1-0 win in Italy in the first leg.
The Bavarians levelled through Mario Gomez's eighth Champions League goal of the campaign in the 21st minute.
Gomez pounced after another terrible mistake by keeper Julio Cesar who spilled a straight-forward shot from Arjen Robben, just like he did in the first leg.
Bayern then took a well-deserved lead thanks to Thomas Muller, this time after a 31st-minute error by Inter defender Thiago Motta, before missing several good chances.
The home team should have notched at least one more goal before the break but squandered a hatful of opportunities, mainly through Gomez and Franck Ribery.
"We stuck in there, even when we were 2-1 down I believed in the team and knew that even if we need to create half a chance we would score," said Leonardo.
Bayern were left to lick their wounds at the end of the match and now look certain to end their season without any silverware.
"It was a self-inflicted defeat," said Van Gaal who will leave the club at the end of the season.
"We should have finished them off much earlier but instead we just let them score with their only two chances in the second half. That's football."
Dutchman Wesley Sneijder levelled against the run of play just past the hour with a drilled shot into the bottom corner of the net.
Eto'o was then invo
Get the best features, fun and footballing frolics straight to your inbox every week.
Thank you for signing up to Four Four Two. You will receive a verification email shortly.
There was a problem. Please refresh the page and try again.