The 24-year-old had been strongly linked with Barcelona and only a few weeks ago, the player rated his own chances of leaving at 50/50, but a meeting last week with future Bayern coach Jurgen Klinsmann has convinced him to put pen-to-paper on a new deal.
"I am really looking forward to staying here, otherwise I would not have done it," said Lahm at a press conference on Friday. "My aim is to win the Champions League with FC Bayern and I am convinced we can do it in the near future."
Lahm was named in Joachim Low's Germany squad for Euro 2008 on Friday and he also earned the recognition of his current coach Ottmar Hitzfeld, who said the new contract was "the best decision" both the player and the club could take.
"Philipp Lahm has a great future ahead of him," added Hitzfeld at his final press conference as Bayern coach at the club's training ground on Friday.
"He is a fantastic player who is already one of the best in the world."
Although Lahm did not go into detail about what had been said in his meetings with Klinsmann and the board last week, he did hint that several big name signings could be made this summer and that may have convinced him of the club's ambition.
"The team is going to be strengthened even more so that we can play a major role in the Champions League," revealed Lahm.