In the last month, Israel has fought a war with Palestinian militants Hamas, seen its cities rocked by communal violence and tamped down protests in the occupied West Bank.

At one point the conflict appeared to bolster Benjamin Netanyahu’s chances of clinging to power. But less than two weeks after a ceasefire, the Jewish state is gripped by political drama as an eclectic crew of opposition parties band together in the most serious attempt yet to oust the veteran prime minister.

For Netanyahu, the stakes could not be higher — he has ruled Israel for 15 of the last 25 years, longer even than founder David Ben-Gurion, and has left an imprint of his brand of pugilistic, rightwing politicking on the nation.

Now a group of allies-turned-foes are plotting to depose him right in the middle of his trial for corruption, a charge that he denies, but that has weakened him politically.

The opposition has until midnight on Wednesday to pull together the first coalition of its kind in Israeli history, stretching across the political spectrum from the far left to the ultranationalist right, united in only one goal — the end of Netanyahu’s political career.

“It’s a bizarre situation,” said Roni Rimon, a veteran political strategist who ran Netanyahu’s 2009 election campaign. “Parties from the deep left, and parties from the deep right are gathering together, and all they have on their agenda is to take down Netanyahu.”

If they succeed, Naftali Bennett, a 49-year old tech millionaire who is more rightwing than Netanyahu and controls only six seats in the 120-member Knesset, could be prime minister. He would step down two years later to be replaced by Yair Lapid, a jovial ex-television presenter who heads a centrist party with 17 seats.

The gambit hinges on an Islamist dentist who has broken from the ranks of Israel’s Arab parties to play the role of tiebreaker — the four seats Mansour Abbas controls as the head of Ra’am are crucial to the complex mathematics of a minority government.

“It’s really like the ‘Game of Thrones’, Israeli politics right now — no one could have predicted this,” said George Birnbaum, the lead strategist and pollster for Bennett’s campaign. “For an Islamist party to be forming a coalition with a guy like Naftali Bennett as prime minister is surreal — the truth is truly stranger than fiction.”

Four elections in two years have left Israelis wary at the prospect of a fifth, if this coalition fails to take form. And even for a country that treats politics as its national sport, the permutations and combinations of this round of frenzied-back room horse-trading are exhausting.

“Just end it, somehow. Finish it now,” said Avital Klein, 38, shopping for groceries while her phone pinged with news updates. “It’s shameful to watch — it’s like we are in a very strange dream.”

But there are many twists left to go. Even if the parties make the Wednesday midnight deadline to submit their proposal for a government to President Reuven Rivlin, it will take another week for this fledgling minority government to schedule a vote to be sworn in.

For Netanyahu, the most skilful politician in Israel, seven days is plenty to find a way to scuttle their plans, said Rimon, the political strategist who kickstarted Netanyahu’s 12-year run as premier in 2009.

Already, he said, Netanyahu has found the “weakest link” — Benny Gantz, an army chief turned politician whose Blue and White party secured roughly the same number of seats as Netanyahu’s in three back-to-back elections, before forming a coalition with him in 2020.

Now at the helm of a deflated Blue and White party, with just eight seats, he has complained that he is being overlooked as an option for prime minister in coalition talks. The horse-trading over portfolios has been slowed down by his demands.

Meanwhile, Netanyahu has spurred his rightwing base into mass protests around the homes of the members of Bennett’s party. Their phones are constantly bombarded with calls accusing them of treason to the Zionist cause, said two people close to the party leadership.

Ayelet Shaked, an influential lawmaker in Bennett’s party, has been placed under police protection, as have Lapid, Bennett, the attorney-general and prosecutors trying Netanyahu, and several journalists.

“He will do more of the same — having a lot of rightwing pressure on Shaked to get her to disagree with the idea of this new government,” said Rimon.

At the same, the Israeli media reported, Netanyahu has made private appeals to Shaked to bring the party back into Likud’s orbit, with the promise of choice cabinet positions in case of a fifth election.

With eight parties to corral, and wrangling over cabinet and ministerial appointments dragging into all-night negotiations, “you can’t say it’s over till it’s over,” Ra’am chief Abbas quipped to the public broadcaster as he joined the coalition building talks on Tuesday.