The Israeli opposition leader, Benny Gantz, has until midnight to form a government that could end Benjamin Netanyahu’s historic tenure or risk pushing the country further towards an unprecedented third round of elections.

Paralysed for months by inconclusive ballot results, the political stalemate has played out during a fraught time for Israel as an increasingly open conflict heats up with Iran, its arch-enemy and a regional powerhouse.

Israel’s military said on Wednesday its jets had bombed dozens of Syrian and Iranian targets overnight in neighbouring Syria, including surface-to-air missiles, weapons warehouses and army bases. Several large explosions were heard in Damascus. Syrian state media said two civilians were killed in the attacks.

The Israel Defence Forces said the widespread strikes were in response to four rockets fired from Syria on Tuesday towards Israel, all of which were intercepted by its air defences. It said it would “continue operating firmly and resolutely against the Iranian entrenchment in Syria”

As a route out of the political deadlock, Gantz, a former army chief, has been attempting to form a unity government with Netanyahu. But there have been vast differences between the rivals during negotiations on key aspects on how it will be forged, including who leads it.

Gantz ran his election campaign on the promise to topple Netanyahu, making it difficult for the opposition leader to accept a power-sharing deal without losing credibility.

Netanyahu, who is waiting to hear whether he will be indicted for three corruption cases, wants to remain in high office while battling the charges. The 70-year-old leader has denied all allegations.

This week, Gantz said talks had stalled. “We have come to understand that we are speaking to a wall,” he said on Monday. And after the pair met on Tuesday night, Gantz suggested no progress had been made. “A third round of elections would be bad, but one cannot abandon fundamental principles and values,” he said.

Neither Gantz nor Netanyahu came out of an April or a repeat September election with a clear majority in the Israeli parliament, the Knesset. Netanyahu failed twice to form a government and Gantz has also struggled during a mandated 28 days timeframe to bring together parties with wildly different politics into coalition.

The country’s apparent kingmaker, Avigdor Lieberman, who heads the far-right Yisrael Beitenu party, ruled out joining Gantz’s government, making it appear more likely Gantz would fail. Lieberman told a news conference on Wednesday afternoon that “both (Netanyahu and Gantz) were guilty” of failing to form a unity government, which was Lieberman’s preferred choice.

One option for Gantz would be to cobble together a minority government without Netanyahu but with the support of politicians from Israel’s Arab minority, which makes up close to a fifth of the country’s population.

To block this route, Netanyahu has run a racist, scaremongering campaign in recent days, warning that a government propped up by Arab parties would be a “historic danger to Israel’s security” and accused Arab politicians of allegiance to Palestinian militant groups.

The Israeli president, Reuven Rivlin, who is tasked with overseeing the government formation, has strongly rebuked Netanyahu.

“The characterisation of all Arab elected officials as a ‘threat’ to the existence of the State of Israel and as a ‘fifth column’ must be emphatically denounced,” he said on Tuesday after meeting members of the prime minister’s Likud party.

Under Israeli law, it is possible that if Gantz fails to secure a government on Wednesday, another parliamentarian could take the mandate, although they would need support from a majority of lawmakers, a position that appears extremely unlikely.

The period in which legislators can nominate any lawmaker last 21 days, after which elections are automatically triggered, and must be held after three months. It would be the third time in a year that Israelis have gone to the polls.