Merkel: A wounded leader
In the end Angela Merkel's candidate won: Christian Wulff, a party insider from the centre-right, is the new German president. But he only got it on the third and final round. It is rare in Germany's post-war history that a presidential election has gone to a third round.
On paper Mrs Merkel would have expected a comfortable majority in the federal assembly. But rebels within her ruling coalition were prepared to embarrass and weaken her by either abstaining or voting for the opposition candidate for president. The scale of the revolt has surprised people here in Berlin.
"That was a big slap in the face," said Gerd Langruth, a political scientist at Bonn university. "I didn't expect that many to vote against her."
"Maybe someone wanted to send a message to the leadership," said Wolfgang Bosbach, deputy leader of Merkel's Christian Democrats. "Great idea," he said, "wrong day."
Within her own ranks there is clearly real unhappiness with her leadership. Some in her coalition have used a very public occasion to damage her. They could have put on a display of unity, but they chose not to.
The core of the problem is the infighting within her coalition with the Free Democrats. There is also widespread disillusionment with her handling of the crisis in the eurozone. Germans do not want to bailout weaker, less disciplined countries like Greece. They worry that time and again there will be raids on German funds. Msr Merkel is seen to have acted indecisively. Some also believe that the German austerity package was not socially fair.
But this political tremor has its roots in a sense that Mrs Merkel has made mistakes and misjudgements and that her coalition seems fragmented.
Der Spiegel, in its online version, said: "Merkel should fear the twilight of her chancellorship."
Those who know her well, like Margaret Heckel, who has written "So Reigns the Chancellor", an account of her leadership, says Mrs Merkel can't be muscled out of power.
"She's very analytical," says Heckel. "If trouble happens she becomes very quiet. The room temperature drops 10 degrees. She withdraws into herself and becomes very quiet to think things over. I've never seen her act impulsively."
She likes being chancellor, according to Heckel, and feels her job is not done. She wants to "get Germany through the financial crisis and back on track".
Mrs Merkel's immediate challenge is to get her coalition functioning smoothly. There are reports of rows and shouting matches as recently as yesterday.
In many ways she is bending Europe to her vision. She believes in austerity, in reducing debt, in balanced budgets. Other leaders may not like being forced to become more like Germany but, so far, she has won the argument.
She will resist pressure from other Europeans to increase domestic demand at home. As Heckel says: "How could she start telling the German public to start buying because one has to save the rest of Europe? The German nation likes to save, to have stable personal budgets. How could she change that? It's futile."
So her instinct will be to fight on, but a Germany with a less confident leader could be a blow to Europe which is looking to its strongest country to help lead it out of recession.