BERLIN, Germany — Christian Wulff, the mild-mannered former state premier of Lower Saxony, was sworn in as Germany’s tenth president Friday.

In his acceptance speech, in front of members of the lower and upper houses of parliament, he advocated for more integration, social justice, more participation in politics and new rules for financial markets.

Normally, choosing a German president is a straight-forward process. The post is largely ceremonial and there is no popular vote. The president is decided by secret ballot in a special assembly, comprised of all German members of parliament and an equal number of representatives chosen by Germany’s 16 states.

But these are not normal times in German politics. This week the vote turned into one of confidence in Chancellor Angela Merkel’s government — and her conservative coalition government only just made it through.

The vote was only necessary after the sudden resignation of former President Horst Koehler, following a controversy over his remarks on the role of the German military in Afghanistan.

With Merkel’s coalition commanding a comfortable majority, the vote was expected to be mostly a show of unity. Instead it became a nine-hour marathon session with Christian Wulff receiving an absolute majority only in the third round of voting.

In the first round, 44 dissenters from Merkel’s own governing coalition voted against its candidate — sending a clear signal of dissatisfaction.

Merkel tried to deflect the humiliation of the vote. "In the end we had a very convincing result. What counts now is that the government does its work,” she told reporters.

Her vice chancellor, Guido Westerwelle, also brushed it off. "I don’t see a problem with the fact that we had three rounds of voting," he said.

But there was criticism from her own ranks. “I can’t believe how little persuasive power and control Mrs. Merkel had” said one representative, who voted in the assembly.

And the opposition and the media made it very clear who’s to blame.

“The loser is Angela Merkel, the loser is the coalition government,” said Claudia Roth of the Green Party.

Nine months into a coalition that included the Free Democrats, the government has earned a reputation more for its infighting than for its policies, and the approval ratings have slumped. The bailout of the Greek government is highly unpopular in Germany and so is the government’s proposed austerity package.

So how much damage has Merkel sustained?

“Her authority has been dealt a blow,” said Oskar Niedermayer, a professor at the Free University of Berlin, but he does not see this as the beginning of the end for her government. “Negotiations about the austerity program will be a crucial point,” he said, adding that if she hasn’t gotten her authority back by then she might not see the end of her term in 2013.

To be fair, the excitement over this week’s election was also because of the candidate the opposition chose.

Joachim Gauck, a pastor and anti-communist civil rights activist from East Germany, is a skilled orator, and his appeal was also helped by not belonging to any party. Following reunification, Gauck was in charge of the archives of the Stasi secret police and won recognition for exposing their crimes. But he also made enemies at that time and the left-wing Die Linke party refused to vote for him.

The new president, Christian Wulff, who is 29 years younger than Gauck, has called on Gauck to support him.

Christian Wulff is not a polarizer. He said he wants to build bridges to bring people together across generation gaps and social divides. He is also a business-savvy president after having served seven years on the supervisory board of Volkswagen, since the state of Lower Saxony has a 20-percent stake in the carmaker.

After several televison interviews this week it seems Wulff's charm offensive is working. According to a poll by Infratest, 72 percent of Germans now believe he will be a good president.

Merkel hopes she can profit from this.

Related Stories