“I am resigning my post as federal president with immediate effect,” Koehler, 67, whose job is largely ceremonial, said in Berlin.
“It was an honour for me to serve Germany as president,” a visibly emotional Koehler told reporters with his wife at his side.
He said he had already informed Chancellor Angela Merkel of his decision.
“I thank the many people in Germany who have put their trust in me and supported my work. I ask for you to understand my decision.”
Koehler came under fire for saying that an export-reliant country like Germany occasionally needed to defend its economic interests by preventing regional instabilities like that in Afghanistan.
Such regional instabilities “certainly have a negative impact on us through trade, jobs and income,” Koehler told German radio on May 22.
A former managing director of the International Monetary Fund, the popular Koehler was elected to the post of president in 2004 and re-elected in 2009.
Polls show that a majority of Germans are opposed to the mission in Afghanistan.
Koehler said his comments were “misunderstood” and that his remarks were not meant to refer to the mission in Afghanistan, where Germany has 4,500 troops.
Deccan Herald is on WhatsApp Channels| Join now for Breaking News & Editor's Picks