Likud candidate Reuven Rivlin emerged victorious Tuesday from Israel’s presidential elections at the Knesset, winning the post by a 63 to 53 margin after two rounds of voting.

Rivlin beat out Hatnua candidate Meir Sheetrit, a veteran MK from the center of the political spectrum. He will take over the office of the president after President Shimon Peres steps down after seven years on July 26.

Rivlin was considered the favorite coming into the race after he secured the public support of Prime Minister Benjamin Netanyahu several weeks ago. But there was considerable speculation that outsider Sheetrit would pip him on the second round run-off. Rivlin had failed to win the presidency seven years ago, when Peres beat him, and many analysts believed he was about to fail again.

At a toast following the announcement, Rivlin pledged to abandon party politics and become “a man of the nation.” The President’s Residence, which he will shortly occupy, is “the house of all Israelis,” he said.

The president elect briefly put on a skullcap and recited the peace blessing. He also turned to Sheetrit during his address and said, “What a fight you put up.”

“Citizens of Israel,” Rivlin said in closing. “I thank you for your trust. Long live Israeli democracy, long live the state of Israel.”

Rivlin came out on top of the first round with 44 votes, while Sheetrit garnered 31, Dalia Itzik 28, Dalia Dorner 13 and Dan Shechtman just one vote. Two of the 119 votes were invalidated because there were two slips inside the envelope, and MK Meir Porush did not vote because he was abroad.

Sheetrit kept the voting close in the run-off round, as he was able to pick up votes from Israel’s left wing that had gone to Dorner, Itzik and Schechtman in the first round.

The moderate Sheetrit supports Palestinian statehood, while Rivlin has gone on record as an opponent of an independent Palestinian state.

Still, lawmakers from across the spectrum congratulated Rivlin after the win.

Itzik personally threw her support behind Sheetrit.

Meretz party leader Zahava Gal-on said that five of her six party members voted for Dalia Dorner in the first round, and predicted that Sheetrit would get their votes.

And during the course of second-round voting, Hatnua party reportedly made a strong last-minute push with left-wing MKs and opponents of Reuven Rivlin on the right to cast their votes for the more moderate Sheetrit.

However, in the end Rivlin’s broad base of support took the victory.

His victory marked the end of a tumultuous race that will likely be remembered for its scandals and controversy.

Just four days before the election, police questioned former candidate and Labor MK Binyamin Ben-Eliezer regarding financial improprieties and less than 24 hours later, he withdrew from the race.

Last month, Energy Minister Silvan Shalom chose not to run for the presidency in the wake of allegations of sexual impropriety; the allegations were not substantiated.

And at one point, Netanyahu reportedly tried to garner support to abolish the office of the presidency because he was dissatisfied with the candidate pool, particularly Rivlin. In the end, however, he endorsed Rivlin for the post.