Israel is at war with Hamas, Jewish-Arab mob violence has erupted inside Israel, and the West Bank is experiencing its deadliest unrest in years. Yet, this may all bolster Prime Minister Benjamin Netanyahu. Just over a week ago, the longtime Israeli leader’s political career seemed all but over. He had failed to form a coalition government following an indecisive parliamentary election, and his political rivals were on the cusp of pushing him out of office. Now, as Israel and Gaza’s Hamas rulers wage their fourth war in just over a decade, Mr Netanyahu’s fortunes have changed dramatically. While his rivals’ prospects have crumbled, Mr Netanyahu is back in his comfortable role as Mr. Security, and the country could soon be headed for yet another election campaign that would guarantee him at least several more months in office. The stunning turn of events has raised questions about whether Mr Netanyahu’s desperation to survive may have pushed the country into its current predicament. While opponents have stopped short of accusing him of hatching just such a conspiracy, they say the fact that these questions are being asked is disturbing enough. “If we had a government, security considerations would not be mixed with political considerations,” opposition leader Yair Lapid wrote on Facebook. “No one would ask themselves why the fire always breaks out just when it’s most convenient for the prime minister.” Mr Lapid appeared to be poised to make history early last week, saying he was wrapping up the final details of arranging a government that would end Netanyahu’s 12-year rule. “In a few days, we should be able to swear in a new Israeli government that is functional and that is based on broad agreements and the common good,” he declared, hours before the war erupted. The sudden outburst of fighting was the culmination of a series of events that have made it increasingly difficult, and maybe impossible, for Mr Lapid to assemble his coalition. His alliance was to include diverse groups that span the spectrum from right-wing to left-wing Jewish parties, as well as an Islamist party, unified by little more than their opposition to Mr Netanyahu. Such a coalition would make history. An Arab party has never officially been part of an Israeli governing coalition. Mr Netanyahu himself had courted the same Arab party when he was granted the first chance by Israel’s figurehead president to assemble a coalition government after the March 23 elections. But as it became clear Mr Netanyahu could not secure the required parliamentary majority, things began to heat up between Jews and Arabs in the contested city of Jerusalem, in large part due to the actions of the prime minister’s allies. Israelis and Palestinians both claim east Jerusalem and its sensitive holy sites. These competing claims lie at the heart of their conflict and have repeatedly triggered violence. The Cabinet minister in charge of police, a Netanyahu loyalist, authorised the closure of a popular gathering spot outside Jerusalem’s Old City used by Palestinians during the Muslim holy month of Ramadan. When protests broke out, heavy-handed Israeli police tactics led to days of unrest that peaked with police raids on the Al Aqsa Mosque. The violent scenes caused outrage across the Muslim world. At the same time, Jewish settlers pressed ahead with attempts to evict dozens of Palestinians from their homes in a nearby east Jerusalem neighbourhood. Itamar Ben-Gvir, a leader of a racist anti-Arab party aligned with Mr Netanyahu, temporarily set up what he called a “parliamentary office” in the neighbourhood, further enraging residents. Then, on May 10, in an event widely seen as a provocation, thousands of far-right flag-waving Israeli activists gathered for a planned march through the heart of the Muslim Quarter of the Old City to celebrate Israel’s capture of east Jerusalem in 1967. At the last minute, the Israeli government ordered marchers to change their route, but by then it was too late. Hamas, saying it was protecting Jerusalem, launched a barrage of long-range rockets at the city, crossing an Israeli “red line” and sparking the war. As the war intensified, violent clashes between Jews and Arab mobs erupted in cities across Israel. The violence also spilt over to the West Bank, where more than 20 Palestinians have been killed in stone-throwing demonstrations against Israeli security forces in recent days, according to Palestinian health officials. In this fraught environment, it appears unlikely that Mr Lapid will be able to cobble together a government by a June 2 deadline. Naftali Bennett, a far-right politician and key partner, abandoned the talks last week after the fighting began. Mansour Abbas, the leader of the Arab party, suspended negotiations. He has said he will resume them if the fighting ends, but time is running out. Mr Lapid’s office says he will work until the last minute to try to form a government. If he fails, the country most likely will be plunged into an unprecedented fifth election in little over two years. It is a script that fits Mr Netanyahu’s needs well and reinforces his image as a survivor. The unrest has diverted attention away from his continuing corruption trial, and Mr Netanyahu is at his best when focused on security issues, projecting a calm and powerful demeanour in his frequent TV appearances. Mr Netanyahu has been desperate to remain in office throughout his trial, using the position to rally public support and lash out at police and prosecutors. A new campaign would leave him in office until at least the new election this fall. It would also give him another chance at forming a friendlier coalition with his religious and nationalist allies that could grant him immunity from prosecution. Gayil Talshir, a political scientist at Israel’s Hebrew University, said she did not think Mr Netanyahu had conspired to keep himself in office. But she called him a master of manipulating events in his favour. “I think he controlled how much oil he puts into the fire,” she said. “From Netanyahu’s perspective, he’s looking only at his trial and his power base. This is where Israeli politics is at. It’s the political survival of this prime minister and not the public interest.”