Shimon Peres was elected Israel's ninth president that capped his six-decade political career, but was overshadowed by rape allegations against the sitting president.
Peres, of the ruling Kadima Party, won the support of 86 of parliament's 120 members in a second round of yea-or-nay voting in which he stood alone. His two rivals, Reuven Rivlin of the hawkish Likud and Colette Avital of the centrist Labor, withdrew from the race after he seized a commanding lead in the first round.
The new president, an 83-year-old Nobel Peace Prize winner who has held all of Israel's top civilian posts, but failed in all his bids for elected office, is to be sworn into office on July 15 for a seven-year term.
In a speech to lawmakers following his victory, Peres said he saw his new role as a unifier of Israel's fractured society.
"The president's role is not to deal with politics and partisanship, but to represent what unites us in a strong voice," he said.
Peres had been seen as a shoo-in to win the post in 2000 only to lose in a stunning upset to the now-disgraced Moshe Katsav, a political backbencher with the blessing of a prominent rabbi.
The office of president, conceived as a ceremonial post held by a prominent statesman or thinker, has been tainted by allegations that Katsav raped or otherwise sexually assaulted four women employees. Katsav has not been formally charged, pending a final hearing before Israel's attorney general, but has stepped down temporarily to fight the allegations.
Israelis hope that Peres, with his international stature, will be able to rehabilitate the position.
Speaking at parliament ahead of the vote, Prime Minister Ehud Olmert of Kadima said "the history, actions and contributions of Shimon Peres to the State of Israel" made him "a model" for the ideal presidential candidate.
The spiritual leader who sealed his fate last time, Rabbi Ovadiah Yosef of the ultra-Orthodox Shas Party, backed Peres this time, and that helped to take him over the top.
Political science professor Gideon Doron of Tel Aviv University said lawmakers' desire to restore something of the presidency's prestige ultimately prevailed over political differences.
The lawmakers also made a sentimental choice, Doron said, feeling that after a long string of electoral defeats Peres finally deserved to win.
A top aide to Israel's first prime minister, David Ben-Gurion, Peres was elected to parliament in 1959, then held a series of top posts, including the premiership, as well as minister of defense, finance and foreign affairs.
But he was never elected prime minister outright, serving once in a caretaker role in the 1970s, and once in the 1980s under a rotation agreement with political opponent Yitzhak Shamir after a general election failed to produce a clear winner. He served as premier again in the 1990s after Yitzhak Rabin was assassinated by a Jewish extremist.
Age was not been a negative factor in the race. If anything, Peres is widely seen as having the gravitas the position demands.
Peres received an unexpectedly high 58 votes in the first round of voting, as against 37 for Rivlin and 21 for Avital.
Shortly after the votes were tallied, Avital announced she would not advance to a second round and Labor said it would throw its support to Peres, who spent most of his political career in that party before bolting in 2005 to join Kadima.
Shortly afterwards, a weeping Rivlin said he, too, would pull out of the contest, and asked the legislature to unanimously back Peres. Likud leader Benjamin Netanyahu, a fierce critic of the dovish Peres, said his party, too, would vote for him.
In the second round, 86 lawmakers voted for him, and 23 against him.
Why should Netanyahu be a friend of Russia? Benjamin Netanyahu is the Prime Minister of the State of Israel. He defends the national interests of the State of Israel
When General Wesley Clark spoke about the famous list of seven Middle Eastern countries to be demolished in five consecutive years, he has done nothing but remark, for the last time, if there was any need, Washington's willingness to redesign the Middle East within a more general framework of global domination.