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, 52, stepped down over corruption claims involving a dubious home loan. He denies any wrongdoing.
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, from 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 Mr Wulff was convinced he had "acted legally correctly" but was "stepping back from the office, from service to our people".
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.
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 problems 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, who previously was premier of Lower Saxony, was later asked in the state'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.
There were also corruption allegations against Mr Wulff, involving receiving political favours and free holidays from business executives.
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.