“During last season I made a decision to end my international career after the World Cup,” Lahm wrote in an open letter on the German soccer federation website.
“I shared my decision with Germany coach Joachim Loew at breakfast on Monday. I am happy and thankful that the end of my national team career coincided with winning the World Cup in Brazil.”
Lahm's decision came as a shock to German soccer federation (DFB) president Wolfgang Niersbach.
Lahm, who picked up the last of his 113 caps in the 1-0 World Cup final victory over Argentina on Sunday, will continue playing for club side Bayern Munich.
Despite the old adage saying you should always go out on top, Bayern acknowledged on their website that Lahm's decision had taken them by surprise.
Many German fans also reacted with disbelief on Twitter given Lahm's relatively young age to quit the international scene.
Germany's dominant performance in Brazil, including a 7-1 thrashing of the hosts in the semi-finals, also suggested an assault on Euro 2016 glory was well within their and Lahm's reach.
Lahm, who started his Germany career in February 2004, was one of the top players in Brazil as he effortlessly switched between midfield and right back.
He barely made a mistake all month and was among the nominees for the player of the tournament award.
The Bayern captain has enjoyed a stellar career having also led his club side to a Champions League, Bundesliga and German Cup treble in 2013. REUTERS