Only minutes earlier Bayern president Uli Hoeness had told reporters he knew nothing of Lahm's retirement and said any announcement would be a joint one with the club.
The 33-year-old Lahm, who retired from worldwide football after leading Germany as captain to the World Cup title in 2014, says "it's just a few more months but no more".
Lahm was reportedly offered a sporting director position by Bayern Munich but turned it down.
"We are talking about more than a year and I believe that I am not able to maintain the level that I am used to and my teammates are used to".
Lahm announced the news after Bayern's 1-0 win over Wolfsburg in the DFB-Pokal, having made his 500th Bayern appearance against Schalke on Saturday.
Bayern Munich captain Philipp Lahm thanks the fans after the team's win against Benfica in the Champions League on 13 April 2016.
European Union leaders launch scathing attack on Donald Trump
Ms Merkel said she was "gratified" that the Prime Minister had said she wanted to see a "strong EU", even after Britain had left. But she added that there was also a "clear recognition" that Europe needs to step up its independent defense capability.
Chairman Karl-Heinz Rummenigge put out a statement on Wednesday saying the club is "surprised by Philipp Lahm and his advisor" and he had "assumed a joint statement would be made".
"Lahm would have been a sports director without a seat on the board (of directors) - unlike predecessor Matthias Sammer (2012 to 2016)".
Lahm will end his career as a Bayern legend, yet there was a time when his future at the club was uncertain as he was sent on a two-year loan to Stuttgart in 2003.
"We want to make it clear that the doors at Bayern Munich will remain open for Philipp".
"I always approached this decision with a lot of thought".
Until then, fans will remember Lahm as a legendary player, who led Germany to victory at the 2014 FIFA World Cup and revolutionized the fullback position.
- Brazil accuses Canada of unfairly supporting Bombardier — WTO
- First Tomb Raider movie pics show the new Lara Croft
- MP Says New US Sanctions against Iran Breach of JCPOA
- UP Election 2017: CM Akhilesh Yadav to address election rallies in Meerut
- UK's May to reiterate settlements breach of trust to Netanyahu
- Is this new Selena Gomez song about Justin Bieber?
- Snow, freezing rain headed to Maine
- Nicki Minaj Airs Out Giuseppe Zanotti For 'Racism And Disrespect'
- Disney Beats Year-End Earnings Expectations, But Revenues Fall Short
- Kim Jong Un fires spy chief, instead of killing him