The criminal investigation deals with charges of corruption over a home loan he accepted during his tenure as prime minister of Lower Saxony state between 2003 and 2010.
Merkel had worked hard to get Wulff, an ally, in her centre-right Christian Democrat party, appointed as president in 2010. Already battling hard to pull Europe out of its debt crisis, Merkel was hit by the resignation at a time when the last thing she needed was a domestic crisis.
Wulff announced his resignation with his wife by his side, and said Germany needed a president who "enjoys the trust of not only a majority but a broad majority of citizens".
"I am stepping down from the office of federal president to free up the way quickly for a successor. The developments of the past few days and weeks have shown that trust and thus my effectiveness have been seriously damaged," he said. "For this reason it is no longer possible for me to exercise the office of president at home and abroad as required. I have made mistakes, but I was always honest," he said.
Confronted by the domestic headache, Merkel cancelled a visit to Italy to meet Prime Minister Mario Monti, to deal with the crisis, and sought a consensus candidate from all major political parties to replace Wulff. She said she accepted his resignation "with respect but also with regret".
The prosecutor's office in Hannover said last evening it had requested the Bundestag, the lower house of parliament, to lift the president's immunity against prosecution as it has reasons for an "initial suspicion" that he took advantage of his official position for personal gains. This will be the first time in Germany's post-war history that a head of state is subjected to a criminal investigation while in office.
Wulff has been facing a barrage of criticisms in recent weeks over number of corruption allegations, including the financing of his private villa in Hannover with a credit of 5,00,000 euros from a business friend's wife, spending holidays on the hospitality of business friends, availing business contacts for election campaign support and other personal benefits as well as financing business promotion events with state funds.
The presidential post is largely ceremonial in Germany but the development is nevertheless embarrassing for Merkel, who had handpicked Wulff for the post. In the interim, Horst Seehofer of the Christian Social Union, the Bavarian sister party of the CDU, will be acting president.
In 2010, Wulff became Germany's youngest president of Germany at the age of 51.