BERLIN: Horst Koehler, the former head of the International Monetary Fund, was re-elected on Saturday German President with a narrow one-vote victory that averted an embarrassing defeat for Chancellor Angela Merkel.

Mr. Koehler’s re-election by a special federal Assembly in the Reichstag Parliament building gave Ms. Merkel’s Christian Democrats (CDU) and their conservative allies an important morale-boosting triumph four months before September’s parliamentary election.

Mr. Koehler got 613 votes in the 1,224-seat Assembly, winning by the narrowest majority in the first of three possible rounds of voting after a testy year-long political battle that put strains on Ms. Merkel’s grand coalition with the Social Democrats.

“Obviously I’m pleased he won in the first round,” a beaming Merkel told reporters. “It’s no secret that we’re eager to have different majority in Parliament [in September]. That was our goal here and we accomplished it. It’s good news for Germany.”

Ms. Merkel’s CDU rules in a loveless grand coalition with the SPD, who backed university president Gesine Schwan on Saturday. Ms. Merkel hopes to form a coalition with the liberal Free Democrats (FDP), now in opposition, in September.

The SPD is also eager to see the grand coalition ended.

Mr. Koehler’s 613 votes was exactly the number he needed to win re-election as Germany’s ceremonial head of state though it was one vote less than the CDU and their allies had in the body.

Ms. Schwan won 503 votes. Narrowly beaten by Mr. Koehler in 2004, she had hoped to siphon away enough conservative votes to win — or at least force a second and third round where her chances for an upset win were expected to rise. The victory of Mr. Koehler (66) in the first round was expected to give Ms. Merkel a boost ahead of the September vote, in which the 54-year-old Chancellor is seeking a second four-year term.