"I am happy and thankful that my national team career ended with the World Cup win in Brazil," Lahm said. "I have been on holiday for three days and have peace and time to come to terms with the end of my national team career. Many thanks for a wonderful time."
Lahm told Sport Bild magazine he was leaving the team in "full harmony."
"Ten years in the national team, three years for Bayern - Philipp it was a pleasure to play in one team with you," Germany forward Lukas Podolski tweeted. FIFA president Sepp Blatter said in another tweet: "Philipp Lahm is a model pro & his brilliant career will continue after international retirement. Some way to bow out!"
Chancellor Angela Merkel paid tribute to the player who took over as captain for the 2010 World Cup, when Michael Ballack dropped out through injury. "I want to take the opportunity to express my great respect for what he has done for the national team," Merkel said.
Former Germany player and coach Rudi Voeller said the decision was "definitely a surprise for many. Philipp Lahm is the type of player you would have expected at the next World Cup with his playing ability and fitness."
Lahm recently extended his contract with Bundesliga champion Bayern to 2018. The 30-year-old took over the German captaincy from Michael Ballack in 2010.
Lahm, who has a contract with Bayern Munich until 2018, will continue playing club football