German President Christian Wulff has announced his resignation, after prosecutors called for his immunity to be lifted.
An ally of Chancellor Angela Merkel, Mr Wulff is embroiled in a scandal over a home loan that he accepted when he was premier of Lower Saxony.
Mrs Merkel cancelled a visit to Italy on Friday to deal with the crisis, and said she regretted that he had quit.
German media say the crisis is unprecedented in post-war Germany.
Mrs Merkel had fought to get Mr Wulff, an ally in her centre-right Christian Democrat party (CDU), appointed as president. He had been in the job for less than two years.
She said she accepted his resignation "with respect but also with regret".
"He dedicated himself to the interests of Germany," she said in a brief statement at 10:30 GMT, shortly after his announcement on Friday.
She said he had "decided to make a step back and put the interests of the general public to the fore".
Germany's political parties will now seek to agree on a new candidate for president, she said.
In the interim, Horst Seehofer of the Christian Social Union (CSU), the Bavarian sister party of the CDU, will be acting president.
The president's role is largely ceremonial, to serve as a moral authority for the nation. Mr Wulff denies any wrongdoing.
The BBC's Berlin correspondent Stephen Evans says the affair is just a headache for Mrs Merkel, whose approval rating is high among the German people.
However, she does not need any new headaches as Germany wrestles with the eurozone debt crisis, our correspondent adds.
"The developments of the past few days and weeks have shown that (the German people's) trust and thus my effectiveness have been seriously damaged," Mr Wulff said in a brief statement.
"For this reason it is no longer possible for me to exercise the office of president at home and abroad as required."
The scandal surrounding Mr Wulff escalated in December.
At the centre of the row is the story - first published by the Bild newspaper - that Mr Wulff received a low interest 500,000 euro loan (£417,000; $649,000) from the wife of a wealthy businessman in October 2008.
Mr Wulff was later asked in Lower Saxony's parliament if he had had business relations with the businessman, Egon Geerkens, and said he had not, making no mention of his dealings with Mr Geerkens's wife.
The president was also heavily criticised for trying to force Bild not to break the story in the first place.
It has emerged that he left an angry message on Bild chief editor Kai Diekmann's phone, saying the story must not be published.
Mr Wulff has since apologised to Mr Diekmann.
On Thursday, prosecutors in Hanover, capital of Lower Saxony, said there were "enough actual indications" that the president had acted improperly.
"Therefore they have asked the president of the German Bundestag [the lower house] to lift the president's immunity."
The move is formally required to start proceedings against Mr Wulff, although this does not mean necessarily that he will be charged.
The Bundestag's committee on parliamentary immunity is expected to consider the prosecutors' request at a session starting on 27 February.