JERUSALEM • People don't call Mr Benjamin Netanyahu "the magician" for nothing.
The Attorney-General had already served notice that he plans to indict the Israeli Prime Minister on multiple counts of bribery and fraud. A popular former military chief with a reputation for integrity had convinced many in Israel that their leader had to go.
But the scandals were not enough to sink Mr Netanyahu's bid to become Israel's longest-serving prime minister. His nationalist base rallied to his aid, cushioning him against likely charges, and if current trends hold, he will have led Likud to one of its best showings ever in Tuesday's closely fought elections.
Retired general Benny Gantz has yet to concede defeat, but with 98 per cent of votes counted, Mr Netanyahu's alliance with right-wing and religious parties is on track to secure 65 seats in the 120-seat Parliament, or Knesset, giving him a clear path to form the next government.
"People say: I don't care if he is corrupt or not, I don't care if he took a few cigars or presents, the main thing is that from my point of view, the economy is growing and there is security," said Dr Erez Cohen, a senior lecturer at Ariel University.
The election result could ripple across a volatile region. Peacemaking with the Palestinians has stalled under Mr Netanyahu's watch; instead, he opted to improve Israel's ties with Gulf Arab states by leveraging a shared distrust of Iran.
Just ahead of polling, Mr Netanyahu pitched for right-wing voters who might be tempted to back other nationalist factions, suggesting he could annex Jewish settlements in the West Bank that Palestinians want for the heartland of a future state.
Dr Hanan Ashrawi, a veteran official from the Palestine Liberation Organisation, said Israelis had chosen racism and permanent conflict.
"They have chosen an overwhelmingly right-wing, xenophobic and anti-Palestinian Parliament to represent them," she said. "Israelis chose to entrench and expand apartheid."
The final tally is unlikely to be announced by today, as about 200,000 votes cast by Israeli soldiers could take longer to filter through and produce some last-minute surprises.
After declaring victory early in the night, Mr Gantz's Blue and White party watched as the numbers turned against it in a knife-edge vote. By morning, Mr Gantz admitted that the odds were not in his favour, but issued a statement to supporters saying the movement was only at the beginning of its journey. The 38-year military veteran entered politics in late December, building his bloc into a powerful insurgent force.
"We will not stand down from our civil duty to represent over a million citizens who searched for an alternative. We have an historic achievement under our belt. We have a reason to be proud," Mr Gantz wrote.
Israel's economy grew nearly 75 per cent during Mr Netanyahu's decade in power, expanding even during the global recession, though the gains have not done much to close the gap between rich and poor.
"They look at the bottom line," said Dr Cohen, the Ariel University lecturer. "If the system is good for me, or at least better than the alternative, I'm willing to shut my eyes to any corruption."