Horst Köhler, who was president of Germany for six years, has left his post as UN envoy for the territory of Western Sahara. His departure on health grounds leaves efforts to resolve a decades-long dispute in limbo.
The former German president said he was stepping down on Wednesday, two years after taking the helm of the peacekeeping mission.
The 76-year-old informed UN Secretary-General Antonio Guterres in a phone call, a statement from the UN said.
In the role, Köhler had spearheaded UN efforts to end the long-standing impasse between Morocco and the Polisario Front liberation movement.
Guterres thanked Köhler for his "steadfast and intensive efforts which laid the foundation for the new momentum in the political process on the question of Western Sahara," the statement said.
The resignation comes after two rounds of talks that marked the first time in six years that parties have met at the negotiating table.
Morocco, which annexed the territory after Spain withdrew from it in 1975, considers Western Sahara an integral part of its territory. The Polisario Front demands a referendum on independence, but Morocco has rejected this, offering autonomy instead.
The two sides fought a war between 1975 and 1991 when a ceasefire agreement was reached that was enforced by the UN's MINURSO peace mission.
The recent talks have involved Morocco, Algeria, Mauritania, and the Polisario Front.
Köhler was German president, the country's largely-ceremonial head of state, from 2004 to 2010 and served as head of the International Monetary Fund from 2000 to 2004.
He resigned over comments about the need for countries like Germany, which are heavily reliant on foreign trade, to understand the importance of military interventions in upholding their interests. Köhler's words were widely construed as relating to Germany's domestically unpopular role in the NATO-led fighting force in Afghanistan, something he denied.