Angela Merkel's handpicked choice for German head of state was forced on Friday into a humiliating resignation, after being caught up in an alleged corruption scandal and misguided attempt to muzzle the press.

German criticism of other European powers for less than perfect statesmanship came back to haunt Merkel's leadership as Christian Wulff finally stepped down as president after a months-long row about a dubious loan, a string of undeclared freebies and his attempt to silence a German tabloid that was investigating the matters.

The 52-year-old has now lost his immunity from prosecution and could potentially face jail if he is found guilty of criminal wrongdoing. Prosecutors indicated shortly before Wulff fell on his sword, that they had "factual indications" of Wulff's long-suspected improper ties to rich businessmen.

Wulff's departure is an unwelcome distraction for the chancellor, who is trying to stop the eurozone from unravelling while maintaining the moral high ground in the European Union. She had to cancel a trip to Rome on Friday morning in order to deal with the fall-out, standing up the Italian premier Mario Monti, with whom she had planned to sit down and discuss the euro crisis. Instead she found herself giving a press conference at her chancellery in Berlin expressing her "personal deep regret" that Wulff, her personal choice for president in 2010, had quit.

Wulff's legacy, said Merkel, would be reminding the nation that its "strengths lie in his diversity" – a reference to the president's remarks in 2010 that "Islam belongs in Germany" which proved controversial at the time. Keen to put a positive spin on the embarrassing situation, she said Wulff's decision to step down ahead of a possible criminal investigation showed the "strengths" of the German legal system – "everyone is treated equally regardless of their position"

Party-loving Wulff, a member of Merkel's Christian Democratic Union (CDU), has been embroiled in the slow-burning affair since mid-December, when it emerged that he had received a private, €500,000 (£415,000) loan from a wealthy friend's wife in his previous job as governor of Lower Saxony state.

That was followed in January by intense criticism over a furious voicemail he left for the editor of Bild, Germany's biggest-selling newspaper, before it reported on the undeclared loan. Wulff apologised, but could hold on no longer when prosecutors on Thursday announced they had asked the German parliament to lift the president's immunity.

They said there is now an "initial suspicion" that Wulff improperly accepted or granted benefits in his relationship with David Groenewold, a German film producer. They requested that Wulff's immunity from prosecution be lifted so they could pursue an investigation — an unprecedented move against a German president.

In a curt five-minute statement at the Bellevue presidential palace on Friday morning Wulff acknowledged that he had lost the trust of the German people, making it impossible to continue in a role that is meant to serve as a moral compass for the nation.

"For this reason," he said, "it is no longer possible for me to exercise the office of president at home and abroad as required." He admitted he had made mistakes but insisted he had not broken the law. He may, however, have damaged Merkel as questions are raised about her judgment. She forced through Wulff's appointment in 2010 over a strong opposition candidate most Germans favoured.

The chancellor is riding a wave of popularity in Germany for her handling of the euro crisis – a poll for state television ARD earlier this month revealed that 85% of Germans thought Merkel represented their country well abroad.

The same poll showed just 42% were satisfied with Merkel's coalition government, and that just 16% considered Wulff to be "honest". The German media lampooned him daily, even inventing a new verb in his honour. "Wulffen" – or literally "to Wulff" – means to be evasive without telling a clear lie.

Wulff courted the media, appearing regularly on the gossip pages after leaving his longtime wife, Christiane, for public relations executive Bettina Körner, 14 years his junior. His conservative colleagues were initially horrified, especially when Körner became pregnant out of wedlock. But he successfully charmed the media and his party after their wedding in 2008, thanks in part to the powerful Bild presenting the Wulff's as the modern "patchwork" family – the couple have a small son, in addition to a teenage daughter from Wulff's previous marriage.

The leading contender to become the 11th federal German president is Joachim Gauck, an anti-Communist human rights activist in East Germany who ran against Wulff in 2010 and embarrassed Merkel by forcing the election in the Federal Assembly into a third round. Other potential candidates include defence minister Thomas de Maiziere, labour minister Ursula von der Leyen, Bundestag president Norbert Lammert and possibly finance minister Wolfgang Schaüble.

A vote in the 1,244-seat Federal Assembly must take place within a month, or by 18 March.

Godparent of 77,000

As Wulff became the second German president to fall on his sword in two years, many in the country were asking whether the country really needed to replace him.

The position is largely ceremonial, involving endless receptions at the grand Bellevue palace in Berlin and certain quirky duties – such as becoming honorary godparent of the seventh child of any German woman. Since the rule was introduced in 1949, 77,100 seventh children have become honorary godchildren of the president. Each is currently given €500 (£415) as a present. The president also congratulates both Germans and foreigners living in Germany on reaching their 100th, 105th and all subsequent birthdays.

But the presidency is not an entirely toothless position. As head of state, he or she (and all 10 presidents have so far been a he) carry out an important constitutional role. They can propose a new candidate for chancellor or dissolve the Bundestag, and, at the request of the federal government and with the consent of the upper house of parliament, the Bundesrat, can declare a "state of legislative emergency".

Mainly, though, the president's job is to be an upright member of society, morally and ethically unimpeachable, representing Germany at home and abroad. When a stream of murky allegations suggested Wulff was not acting as befitted a model German citizen, his days were always numbered.

Sign up for the Guardian Today

Our editors' picks for the day's top news and commentary delivered to your inbox each morning.