Winner given tepid backing by Binyamin Netanyahu after trying to thwart his campaign, in contest riddled with subterfuge

Reuven "Ruby" Rivlin, a member of Binyamin Netanyahu's Likud party, has been elected Israel's president following a vote by members of the Knesset.

A former speaker of parliament, Rivlin defeated his rival Meir Sheetrit in a runoff by 63 to 53 votes. He succeeds the veteran Israeli politician Shimon Peres, 90, who will step down from the largely ceremonial position next month.

Although Israeli heads of state are not involved in political decision making, Nobel peace prize laureate Peres used the presidency as a pulpit for advocating peace with the Palestinians, often taking a more dovish stance than Netanyahu.

The election follows what some analysts have described as one of the dirtiest presidential campaigns in the country's history. Two prominent candidates withdraw after being placed under police investigation and Rivlin targeted by an anonymous smear video sent to MPs.

Despite being a member of Netanyahu's party, the election is being seen as a defeat for the prime minister who had gone to extraordinary lengths to oppose Rivlin before finally giving him his lukewarm endorsement. That included a campaign to have the election delayed, or even have the post of president abolished or stripped of its only real constitutional role – determining who is first invited to form a government after national elections.

It reached a moment of high-farce when Netanyahu called the Elie Wiesel in New York to press him to stand, apparently unaware that the Nobel laureate was not an Israeli citizen and, therefore, ineligible to stand for office.

Commenting in a recent interview in Haaretz, Wiesel said: "Failing to get the positive answer [Netanyahu] wanted, he started putting pressure on me through mutual friends. The pressure was heavy, but I know how to withstand pressure.

"One of the people who put pressure on me said, 'Your father in heaven will see you elected president of the state of Israel. Don't you want him to be proud of you?' But to say yes? To be the president of Israel? Oh, come on. That's not for me. I write books. I'm not cut out for that."

According to reports in the Israeli media, Rivlin had attracted the animus of Netanyahu and his wife, Sara.

Of the two who dropped out, Silvan Shalom was accused of sexual harassment in a case dating back a decade and a half, although he was later cleared it was too late for his campaign. Veteran Labour politician Binyamin Ben-Eliezer, pulled out on Saturday after police questioned him about allegations of financial malpractice.

Ben-Eliezer denied any wrongdoing and said he had been deliberately targeted by enemies out to sabotage his bid.

Netanyahu finally threw his weight behind Rivlin after it emerged he was the public's favourite for the post and with no alternative candidate to field. Although Peres saw himself as an international statesman who travelled frequently, Rivlin – who opposes the creation of a Palestinian state – has said he will concentrate on domestic social issues.

Unlike Peres, Rivlin has called for a confederation with the Palestinians rather than negotiating an independent state – something Palestinian leaders have long rejected.