TEL AVIV (Reuters) - A countdown to a fourth election in Israel in more than a year of political deadlock began on Thursday after Prime Minister Benjamin Netanyahu and main rival Benny Gantz missed a deadline to form a government.

Both men had pledged to join forces in a national emergency government to battle the coronavirus crisis. But they could not agree on terms for power-sharing, with Netanyahu’s corruption trial, due to open next month, looming over their talks.

Under Israeli law, centrist politician Gantz’s failure to put together an administration within the 28 days allotted to him after a March 2 election meant that the Knesset, ‮‮I‬‬srael’s parliament, will now have three weeks to agree on a candidate for the task.

If no nominee is chosen in the next 21 days or if the appointee does not form a government within two weeks of being chosen, parliament will automatically dissolve and a new election will be held.

Further complicating the political picture, Netanyahu, head of the right-wing Likud party and Gantz, leader of Blue and White party and a former armed forces chief, could continue to pursue a deal and rally a parliamentary majority to support it.

Even as Gantz’s deadline expired at midnight, both parties pledged to press on with negotiations.

“I hope majority of MKs (members of Knesset) can be found as soon as possible, preventing a 4th round of elections,” President Reuven Rivlin said on Twitter.

Throughout a stalemate in which elections were held in April and September 2019 and last month, Israel has been run by a caretaker government headed by Netanyahu, whose charges in three corruption scandals include bribery, fraud and breach of trust.

He has denied any wrongdoing.

Gantz and Netanyahu have been negotiating a deal that would keep Netanyahu, Israel’s longest-serving leader, in office for another 18 months, after which Gantz would assume the post, Israeli media reported.

Gantz made clean government a central theme of his election campaigns. But he angered many of his voters - and caused a split within his own party - by reneging on a pledge not to serve with Netanyahu, whom he had called “the defendant”..

An opinion poll on Monday from Israel’s Channel 12 news showed Netanyahu’s handling of the coronavirus crisis has given him a political boost.

It predicted that if an election were held now, Likud would win 40 of parliament’s 120 seats, bolstering Netanyahu’s chances of forming a coalition with traditional right-wing and religious allies, without the need for Gantz’s support.

Israel has reported more than 12,500 COVID-19 cases and 140 deaths. Restrictions have confined most Israelis to their homes, forcing businesses to close and sending unemployment to more than 25%.