JERUSALEM — When Israel’s top satire show launched its recent election special, it depicted an impersonator of Prime Minister Benjamin “Bibi” Netanyahu breaking out of chains in a Houdini-like feat. With a smirk he turned to exit, before realizing his foot was still shackled.

Netanyahu has escaped many a peril in the quarter-century that he has been a dominant ­figure in Israeli politics, including 13 years as prime minister.

There was the first “Bibigate,” when he dramatically confessed an extramarital affair to the Israeli public, and the second, when he was investigated during his first year in office amid allegations of influence peddling. More investigations would follow over the years as stories of extravagant spending by him and his wife, allegedly at taxpayers’ expense, filled Israeli newspapers.

There was the $1,600 bill for his hairstyling and $1,750 for makeup on a 2015 New York trip. There was the $127,000 spent on installing a double bed on an El Al plane for a five-hour flight to London and a $2,700 ice-cream budget. 

And still he has survived, denying all accusations of wrongdoing, staying put when others might have resigned and winning a pair of elections in which he was widely written off.

But the latest corruption cases, which involve allegations of fraud, breach of trust and bribery, have overshadowed this year’s election campaign and left Israelis wondering whether he could be caught in that last shackle. Just days before Israelis vote on Tuesday, polls suggest the prime minister is in a very tight race with his main rival.

If he prevails and stays in office through mid-July, Netanyahu will become Israel’s longest-serving prime minister, surpassing the country’s founding father, David Ben-Gurion. But the question remains: Will his legal troubles catch up with him, or can he escape them once more?

“The guy has the best staying power in politics,” said Eyal Arad, an Israeli political strategist who was an adviser to Netanyahu in the 1980s and 1990s. “He falls, he recuperates, but then he goes on to the next battle.”

That, in part, Arad said, comes from his unshakable belief in himself. 

“He believes that he is the only one who is capable to lead Israel,” he said. “He absolutely believes that.” 

That self-belief has only grown over the years, former advisers say, as Netanyahu has defied the odds to stay in power.

'Bibi being Bibi' 

Last time around, in the 2015 election, Netanyahu had been widely expected to lose. Aron Shaviv, his campaign adviser, recalls how five days before the vote, defeat seemed imminent. 

“We were staring down the barrel of a 5 or 6 percent loss,” Shaviv said. But Netanyahu remained “cool and calculated,” he said. “Straight away we got down to business to work through all the options of this serious problem.”

Netanyahu would call him throughout the night. If Shaviv screened the calls on his cellphone, Netanyahu would call on the house phone and keep ringing until Shaviv picked up.

“My wife always used to joke that she felt like she was in bed with him,” he said. “He has such a deep voice, she could still hear him through the phone.” 

To win, Netanyahu had to do something that did not come naturally — acknowledge he was likely to lose. Campaign research showed that right-wing Israelis were leaning toward smaller parties instead of Netanyahu’s Likud, confident that Netanyahu would still be the prime minister. He was not quick to heed the warnings.

“Bibi being Bibi said: ‘I don’t trust you. But I do trust the data, so prove it to me,’ ” Shaviv said. He watched five hours of focus-group videos before he was convinced. 

Shaviv said Netanyahu immediately went out to do what he does best: He conducted more than 40 media interviews to warn supporters that he was about to lose — and that the left would win. 

Then, on election day, his campaign released a last-minute video declaring that Israeli Arabs were flocking to the polls, potentially threatening to thwart his reelection. The video, which was condemned by many Israelis as racist but may have succeeded in spurring his supporters to vote, was entirely the prime minister’s call, Shaviv recalled.

It worked, and Netanyahu ultimately won. 

“He felt that almost with his bare hands, he managed to win,” said Aviv Bushinsky, a former adviser and chief of staff to the prime minister.

Atmosphere of hate and fear

Netanyahu’s decision to release that video fits a long pattern of divisive politics, critics say, and early on those politics almost tripped him up.

When Prime Minister Yitzhak Rabin was assassinated by an ultranationalist Israeli in 1995, Netanyahu, as leader of the opposition, was blamed by some Israelis, including members of Rabin’s family, for stirring up an atmosphere of hate and fear. Many political observers thought he was too tarnished to defeat Rabin’s successor, Labor Party leader Shimon Peres, in the election a year later.

“After Rabin’s assassination, everyone thought it would be a walk in the park for Peres,” recalled Nahum Barnea, a veteran Israeli journalist. “Nobody believed Netanyahu had a chance.” 

But when Palestinian suicide bombers began blowing up buses and restaurants in Israel, the shine came off the peace process championed by Rabin and Peres. Public opinion swung toward Netanyahu.

Barnea said Netanyahu’s skills as a public speaker also helped him turn the campaign around. 

Shortly before the election, Netanyahu participated in a televised debate, prerecorded at the Labor Party headquarters in Tel Aviv. Barnea watched the session live with about a dozen other journalists. They thought Netanyahu performed well. Then, when Barnea reviewed the recording on television, Peres came off even worse, he said. 

“I ran from the studio to our office,” Barnea said. “I went to the editor in chief and said Bibi won the debate.” 

Netanyahu would go on to win the election with a razor-thin majority. 

Tapping resentment

Netanyahu was not originally tapped to be the star of his family, growing up in the shadow of his older brother Yonatan, or Yoni, whom he idolized. But Yoni was killed in 1976, the lone Israeli military casualty in an operation to rescue more than 100 Israeli passengers and a flight crew held hostage at Uganda’s Entebbe Airport after their plane was hijacked. 

If Yoni had lived, Netanyahu might have stayed in the United States — where he was partly raised and attended Harvard and MIT — and never entered politics. But he did, and despite that privileged upbringing, he went on to find a fierce following among Israel’s blue-collar voters.

Painting himself as a repeated underdog who has been unfairly targeted by the elitist establishment, Netanyahu has tapped into the resentment of Israel’s Mizrahi Jews, whose roots mostly lie in other Middle Eastern and North African countries and who felt shut out of power in Israel’s early years by Ashkenazi Jews of European ancestry.

While Netanyahu is also of Ashkenazi stock, his family had felt alienated from Israel’s Zionist establishment. Netanyahu’s father, Benzion, had been a follower of the revisionist leader Binyamin Zeev Jabotinsky, a rival of left-leaning socialists who dominated the early Zionist movement. 

Netanyahu has survived in part by telling his political base that it is us against them, the right vs. the weak, dangerous and Arab-loving left. 

“Netanyahu’s greatest achievement is keeping his base disgruntled and dissatisfied and angry despite Likud having been in power for three-quarters of the last four decades,” said Anshel Pfeffer, author of “Bibi: The Turbulent Life and Times of Benjamin Netanyahu.” “Netanyahu’s biggest political asset is that he knows how to latch onto his voters’ phobias and keep them alive.”

Yet despite presenting himself as a candidate of the people, he has a love for the high life, which biographers say is his Achilles’ heel.

Over the years, Israeli newspapers have highlighted his penchant for leaving restaurants without picking up the bill and reported scintillating details of the extravagant habits of the Netanyahus. 

Two months ago, the Israeli attorney general decided to charge him in three criminal cases, pending a hearing in which he can present his defense. One of those cases centers on allegations that he and his wife, Sara, received gifts of cigars and jewelry worth around $280,000 in exchange for ­political favors.

But Netanyahu, who denies all charges, has built a loyal base that supports him no matter what and can deliver enough votes to keep him atop Israel’s fragmented politics.

“He just needs to keep his right-wing base voting for him, which he’s done very effectively,” Arad said. 

A different cloth

The personal stakes for Netanyahu are higher in this election than ever before. 

“He understands that the only good way, from his perspective, to fight his legal battles is from power,” Bushinsky said.

Others might have resigned already. Rabin stepped aside in his first term when it emerged that he still had a U.S. bank account several years after working at the Israeli Embassy in Washington, in contravention of Israeli currency regulations. 

Netanyahu’s most recent predecessor, Ehud Olmert, who stepped down when he was indicted, served 16 months in jail for corruption.

But Netanyahu is cut from different cloth and has vowed to stay in office even if he is indicted.

Bushinsky said that if Netanyahu is in power, he is in a stronger position to influence the time frame of the corruption investigations and could even push for legislation to prevent charges being pursued against a sitting prime minister.

He has beaten the legal rap each time since the first criminal investigation back in 1997. At the time, police recommended he be indicted after he was accused of appointing an attorney general who, in return for political support, agreed to be lenient in pursuing an extortion case against one of the prime minister’s political allies.

In an April 1997 editorial, The Washington Post asked, “Can Mr. Netanyahu hang on?” The editorial noted that less than a year into office he was already “hip-deep” in controversy. But already, he had a reputation as a survivor, if not an escape artist.

“The prudent expectation must be that Mr. Netanyahu will somehow come through,” the Post editorial said.