Updated

BERLIN (AP) — Chancellor Angela Merkel failed to secure a swift victory for her candidate to be Germany's president in an election Wednesday, but still appeared likely to get an embarrassingly lackluster win in a vote seen as a test after a bumpy few months.

Merkel's center-right government had a majority in the special parliamentary assembly that chooses the president but her candidate, Christian Wulff, fell short of the absolute majority needed in the first two rounds of voting.

The governing coalition had hoped to show strength after a strife-riven start since it took office in October.

But Wolfgang Bosbach, a lawmaker with Merkel's Christian Democrats, voiced regret that the alliance "hasn't shown the unity — at least so far — that would significantly have stabilized the coalition."

Wulff faced a strong challenge from the main opposition candidate, former East German human rights activist Joachim Gauck.

Still, Wulff — the 51-year-old governor of Lower Saxony state and a deputy leader of Merkel's conservative party — appeared well-placed to win the simple majority needed in a third and final vote later in the day.

He secured 615 votes in the second round, short of the 623 needed to win outright and of the 644 delegates Merkel's coalition had.

Gauck won 490 votes; the hard-left Left Party's candidate, Luc Jochimsen, 123; and far-right candidate Frank Rennicke three. Seven delegates abstained.

The 1,244 delegates — half federal lawmakers, the other half nominated by state parliaments — were voting for the largely ceremonial presidency by secret ballot in Berlin's Reichstag parliament building.

Merkel's center-right coalition has struggled since taking office in October. It has been hit by constant squabbling over policy, while the eurozone debt crisis forced it to push through an austerity drive and unpopular rescue packages for Germany's European partners.

The contest for the presidency has added another layer to its troubles — fueling speculation in recent weeks that Merkel's candidate could even lose, pushing her coalition to the brink of collapse.

The winner will replace Horst Koehler, nominated by Merkel in 2004, who abruptly stepped down May 31. Koehler's move mystified many but he said only that he felt unduly criticized for an interview he gave on the German military's role abroad.

Merkel's coalition has struggled to close ranks in the face of the challenge from Gauck, nominated by two opposition parties and widely viewed as more exciting than clean-cut career politician Wulff.

"The numerous votes Wulff didn't get clearly represent the discomfort over the government's performance and about Merkel's leadership," said Werner Weidenfeld, a political science professor at Munich's Ludwig Maximilian University.

He said it was unlikely that Wulff would fail to win in the end, but if that happened it would be "a real crisis."

"Perhaps one or two people wanted to send a political signal to the leadership" of the coalition parties, Bosbach told Phoenix television. "Great idea, wrong day."

Some center-right assembly members have said Gauck, 70, is a better candidate. Gauck, who after reunification headed the archive that oversees the archives of former East Germany's secret police, is widely respected.

Gauck would likely need support from the Left Party to win, but many in the party — which has communist roots — dislike him strongly.

The main opposition Social Democrats' leader, Sigmar Gabriel, signaled he would try to win the party's support for Gauck. "We will try to make clear to them that this is a great opportunity for their party," he said.

___

Associated Press writers Geir Moulson and Juergen Baetz contributed to this report.