JERUSALEM (Reuters) - Benjamin Netanyahu’s portrayal of Israel as a success story under his leadership and the showcasing of his rapport with U.S. President Donald Trump were vital ingredients in his triumphant election campaign.

FILE PHOTO: Israel's Prime Minister Benjamin Netanyahu shakes hands with U.S. President Donald Trump during their meeting in the Oval Office at the White House in Washington, U.S., March 25, 2019. REUTERS/Carlos Barria/File Photo

The contest was effectively a referendum on Netanyahu’s rule as prime minister for the past decade, a test of his personality and character, after Israel’s attorney general announced in February he intends to charge him in three corruption cases.

In the end, voters kept to the right in granting a fifth term to a leader who has a reputation for getting things done, despite an array of former generals who stood against him -- and were dismissed by Netanyahu as the “weak left”.

Netanyahu denies any wrongdoing and will have the opportunity to plead his case at a pre-trial hearing against the filing of potential bribery and fraud charges.

The veteran leader, who served his first term as prime minister from 1996 to 1999, crafted a bellicose campaign that focused voters on whether they should take a risk on his politically untested challenger, Benny Gantz.

Gantz, a former military chief, was joined in his centrist Blue and White party by two other prominent Israeli generals, a phalanx of officers that failed to unseat Netanyahu, an ex-commando who has held power since 2009.

On the campaign trail, Netanyahu, 69, dominated the news cycle, springing surprises on his supporters and opponents.

He went to the United States to get Trump to sign a decree recognizing Israeli sovereignty over the Golan Heights, seized from Syria in a 1967 Middle East war and considered by the United Nations to be occupied territory. He visited Russia to thank Moscow for honoring his request to recover the remains of an Israeli soldier lost in Syria.

With Trump already having recognized Jerusalem as Israel’s capital, Netanyahu further alarmed Palestinians by announcing during the campaign his intention to annex Jewish settlements in the occupied West Bank if re-elected.

Slideshow ( 2 images )

Palestinians seek a state of their own in the West Bank and Gaza Strip, with East Jerusalem as its capital. Israel captured the areas in the 1967 war and pulled its troops and settlers out of Gaza in 2005, while maintaining a blockade of the enclave.

On social media, Netanyahu pounded out alerts which included unproved accusations that Iran could blackmail Gantz after hacking his phone, although Tehran denied doing so.

“Much of the electorate evidently feels there is no worthy rival to (Netanyahu), and his political base does not believe that he is a crook,” said Amotz Asa-El, a fellow of the Shalom Hartman Institute in Jerusalem.

“Many voters felt more secure keeping in that seat the person who has performed at least reasonably well there, and arguably, more than reasonably well.”

RIGHT TURN

Despite his legal troubles, Netanyahu could bank on an electorate that had largely turned to the right since a 2000-2005 Palestinian uprising.

He also knew that when it came to trying to build a governing coalition he could rely on a likely alliance with ultra-Orthodox parties that have little in common with Israel’s secular left-wing and are hostile to one of Gantz’s partners -- former finance minister Yair Lapid, who has been critical of the religious establishment.

“No one meets Netanyahu’s caliber in terms of his political power, assertiveness, his self-confidence and courage. No one has achieved that and I can’t see anyone getting there,” said Judie Raziel, a 60-year-old religious Jew who lives in the settlement of Maale Adumim in the West Bank.

Netanyahu kept his close ties with Trump in the public eye, erecting billboards in big cities showing the two smiling leaders shaking hands. Trump is hugely popular in Israel.

While Gantz cast himself as a force for national unity, Netanyahu doubled down on divisiveness. He excoriated Gantz as a friend to Israel’s 20-percent Arab minority and the darling of liberal media - codes, to many conservative ears, for dangers to the Jewish state.

Tehilla Shwartz Altshuler of the Israel Democracy Institute deemed the strategy saw “a one-to-one imitation” of Trump’s 2016 presidential campaign: “This was about both spreading fear and sowing a victim-like mistrust in the democratic institutions.”

Ofer Zalzberg, a senior analyst at the International Crisis Group, said Netanyahu played to his constituency by portraying any future Palestinian state as a threat to Israel’s security.

That meant, Zalzberg said, that “even those right-wing voters frustrated with Netanyahu’s conduct went with him”. Gantz stopped short of endorsing Palestinian statehood.

In the final days of the election, Netanyahu launched what Israeli political commentators dubbed a “gevalt strategy”, a Yiddish expression for alarm, aimed at motivating complacent supporters to get out and vote or risk his defeat at the hands of a resurgent left-wing.

On election day itself, Netanyahu went to a beach near the coastal city of Tel Aviv, urging sunbathers to get out of the water and save him at the ballot box - posting a video of his appeal on Twitter.

“The digital effort here was in the micro-targeting - getting the ‘right’ people to come out and vote after creating pressure on the Arabs not to,” Altshuler said.