Benjamin Netanyahu’s political magic has broken, his biographer declared. The longest-serving prime minister in Israel’s history gambled that a second election in six months would win him a mandate when he couldn’t form a coalition. But the results appear to have shifted in favour of rival Benny Gantz’s Blue and White party.

Voters cannot have gone to the polls on Tuesday with any great excitement. Blue and White hewed even more closely to Likud than it did in April’s contest. Overall there was strikingly little change in voting patterns, as one pollster pointed out: a small portion of the right moved to the secular nationalist Avigdor Lieberman, making him look very much like the kingmaker. The outcome is remarkably close, with Mr Gantz just one seat ahead as final results continued to trickle in, and both men vowed to lead Israel’s next government. Mr Netanyahu is a consummate survivor and his will to fight is sharpened by the knowledge that his freedom may depend upon it: he faces pre-trial hearings for three corruption cases in a matter of weeks. No office, no immunity.

The grim tactics that have worked so well for Mr Netanyahu before failed to do the trick. Once again he demonised and sought to intimidate Israel’s Palestinian citizens, but such efforts appeared to backfire: their voting rate increased considerably (though Ayman Odeh’s ability to forge a much more coherent bloc from the Arab parties also played a big part). The apparent failure of the racist, far-right Jewish Power party to cross the electoral threshold is also a relief. But Mr Netanyahu continues to attract substantial support despite a record of dangerous rhetoric and unscrupulous actions which would have ousted any leader with a sense of shame long ago. There was no great electoral repudiation of his race-baiting; still less was this campaign a reckoning with his treatment of Palestinians in the West Bank and Gaza, who do not have a vote. The conflict was notable chiefly by its omission – reflecting the country’s rightwards lurch, with politicians seeking not a solution to the conflict, but ways to manage Palestinians.

Mr Gantz enjoys goodwill in Israel as a former military chief who has no corruption allegations hanging over him. He is thought unlikely to embrace so enthusiastically the likes of Hungary’s Viktor Orbán and more likely to shore up democratic institutions hammered by Mr Netanyahu. He is regarded as more responsible and less divisive than his opponent – not hard. But he has positioned himself as almost indistinguishable on security. When the prime minister vowed to annex the Jordan valley and northern Dead Sea – a move which the liberal pro-Israel lobby group J Street in the US warned “would destroy Israeli democracy and constitute a flagrant violation of international law” – Blue and White’s response was that he had stolen its idea. The fear is that Mr Netanyahu’s continued tenure, coupled with the Trump administration, could lead to his election threats becoming reality this time. Even if Mr Gantz would be more pragmatic, he falls far short of being the change that Israel needs.

If Mr Netanyahu leaves power thanks to this election, it will probably be as much because his history of manoeuvring has come back to bite him as because voters lost faith. Like his friend Donald Trump, Mr Netanyahu was never fit for his office and has debased it. But he is a symptom as well as a cause of what is wrong with his country’s politics, and its biggest problems will not end when he departs, whenever that may be.