Prime Minister Benjamin Netanyahu embraced and formally congratulated President-elect Reuven Rivlin Wednesday on his victory in Tuesday’s Knesset vote and expressed confidence that the two could work together.

“Joint work on behalf of all Israelis is before us,” Netanyahu said in a statement. “We have gone through much together and I am certain that we will now know to put the less good aspects aside and work responsibly for the future of the State of Israel.”

For his part, Rivlin said that “the prime minister and I are committed to full and fruitful cooperation for the State of Israel and the people of Israel.

On Tuesday, Rivlin, a veteran MK from Netanyahu’s Likud party, emerged victorious from a tight presidential race, beating out his centrist opponent, Hatnua MK Meir Sheetrit, by 63 votes to 53 in a runoff to mark the end of a tumultuous campaign that saw one candidate withdraw and another decline to run amid scandal.

During the course of the campaign, Rivlin himself was at the center of reports that Netanyahu was looking into the option of abolishing the presidency to keep him from attaining the post. The two men have been at odds for years.

Eventually Netanyahu endorsed his fellow party member, making him the overwhelming favorite for the post. However, on election day, the Hebrew media reported that Netanyahu’s office was attempting to sabotage Rivlin’s campaign by lobbying for Sheetrit behind the scenes.

After securing the win, Rivlin insisted there was no “bad blood” between him and the prime minister, and that he hoped to work closely with Netanyahu throughout his presidential term.

Rivlin added that he was “not angry at anyone.”

In a bid to lay to rest the rivalry after the vote Tuesday, Netanyahu congratulated Rivlin and said he would work with him.

“I know you will do all you can as president and I promise that I as prime minister … will do the same with you,” he said.

At a toast following the announcement of his win, 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.

Rivlin later visited the Western Wall and the grave of his father, who unsuccessfully sought to be Israel’s third president, on the Mount of Olives.

Netanyahu also praised Rivlin at a toast following the victory, calling him “a man of Jerusalem and a man of the land of Israel.”

Adiv Sterman contributed to this report.