Israeli Prime Minister Benjamin Netanyahu has reached a historic deal with one-time rival parliament speaker Benny Gantz to form a unity government, ending the country's worst-ever political crisis.

The three-year agreement allows Mr Netanyahu, 70, to stay in office for 18 months, during which he is due to stand trial on corruption charges he has long denied.

Mr Gantz, 60, will then take over as premier for the remaining 18 months as Mr Netanyahu bows out after 12 years in office - the longest premiership in Israeli history.

Mr Netanyahu, head of the right-wing Likud party, had squared off against Mr Gantz in three inconclusive elections over the past year, but neither had secured enough support to form a viable governing coalition.

As the Covid-19 epidemic intensified following the last election on 2 March, calls mounted for them to unite and offer the country a rare period of political calm as it battles an unprecedented health crisis.

"I promised the state of Israel a national emergency government that will act to save the lives and livelihoods of Israeli citizens," Mr Netanyahu tweeted shortly after the deal was announced.

Mr Gantz stressed that the deal had prevented "a fourth election".

Through the first six months, the government will be defined as an "emergency" body focused primarily on containing Covid-19 and mitigating the economic devastation it has caused.

Israel has more than 13,500 confirmed virus cases, including more than 170 deaths, and a nationwide lockdown has left huge numbers of people without income.

The deal evenly splits cabinet posts between Likud and Mr Gantz's centrist Blue and White alliance.

Mr Gantz, a former army chief, will officially become "prime minister-designate" when the government is sworn in, stepping down as parliament speaker.