Reuven Rivlin, 74, envisions a “Greater Israel” and opposes the creation of a sovereign Palestinian state. (Lior Mizrahi/Getty)

Israelis, who are quite familiar with rough-and-tumble politics, were taken aback to see the race for president — a strictly ceremonial post in this parliamentary system, with lots of red carpets, windy toasts and wreath laying — turn into a political brawl.

After weeks of anonymous smears and unflattering leaks, and after two of seven candidates dropped out because they were suddenly subjects of criminal investigations, the parliament chose hard-liner Reuven “Rubi” Rivlin on Tuesday as the 10th president of Israel. He will succeed nonagenarian Shimon Peres, whose seven-year term ends next month.

The president is Israel’s face to the world. On Sunday, the courtly and cerebral Peres — a peacenik by Israeli standards — met with Palestinian Authority President Mahmoud Abbas at a prayer summit with Pope Francis at the Vatican.

Rivlin, 74, a veteran politician, also has pleasing manners, friends and critics say, and was a famously evenhanded speaker of parliament who tangled repeatedly with Prime Minister Benjamin Netanyahu, a fellow Likud party member.

But unlike Peres, Rivlin is a hard-right native son who is opposed to the creation of a sovereign Palestinian state and who envisions a “Greater Israel,” a Jewish homeland stretching from the Jordan River to the Mediterranean Sea, with Jerusalem as its undivided capital.

Rivlin beat his opponent, centrist Meir Sheetrit, 63 to 53 by secret ballot in a second round of voting in the Knesset, the Israeli parliament.

“He is a hawk and a democrat,” said Gideon Rahat, a senior fellow at the Israel Democracy Institute. “He supports a Greater Israel, but he also supports giving Palestinians not a state but full and equal rights.”

Of course, none of this is supposed to matter. The Israeli president has no real powers and is expected to remain above the political fray.

“The President’s Residence is a place for dialogue, partnership, and compromise,” Rivlin wrote in a recent editorial. “In this sense, the presidency constitutes the ‘additional soul’ of the democratic system.”

Still, Netanyahu variously sought to recruit someone, anyone, to beat back Rivlin’s candidacy, including Nobel peace laureate Elie Wiesel, who isn’t even an Israeli citizen. Wiesel declined the offer.

After that setback, Netanyahu sought to abolish the office of the president entirely. When that seemed impossible, he pushed for a delay in the election.

Netanyahu and Rivlin crossed swords when the latter served as speaker of the Knesset. He has also sparred with Israel’s foreign minister, Avigdor Lieberman.

“Since Netanyahu never gives interviews to the Israeli press, we haven’t heard from him directly, so all we have is rumors, and rumors are that Netanyahu’s wife doesn’t like Rivlin and that Rivlin is too democratic for Netanyahu’s taste,” said Tal Schneider, a popular political blogger in Israel. Meaning: Rivlin sought to curb the power of Netanyahu’s premiership.

Israeli analysts say that the Peres presidency was unique, because Peres, as one of the founders of the state of Israel, was a world-class figure comfortable on the international stage — hosting showy conferences, getting serenaded by Barbra Strei­sand for his 90th birthday, being pals with Bill Clinton and huddling with Secretary of State John F. Kerry.

Peres is credited with returning shine to a post that was tarnished by predecessor Moshe Katsav, who was convicted in 2010 of two counts of rape and is serving a seven-year sentence in a minimum-security prison.

Cynics also say that Peres provided Netanyahu with cover, showing Israel as a nation struggling mightily to make peace with the Palestinians, even as Netanyahu’s coalition ministers undermined such efforts.

Reuven Hazan, a professor of political science at the Hebrew University of Jerusalem, said Peres is an extroverted leader who focused on presenting Israel to the world. Rivlin, Hazan said, would be a president for Israelis.

“I am willing to say that most of your readers won’t likely remember his name six months from now,” Hazan said.