TEL AVIV – Prime Minister Benjamin Netanyahu and Blue and White party leader Benny Gantz signed a coalition agreement to form a unity government, ending a year and a half political deadlock.

Under the agreement, Netanyahu would retain the premiership for another 18 months after which Gantz is slated to take over.

The two parties released a joint statement that said the new government would be formed to deal with the coronavirus pandemic.

“I promised the State of Israel a national emergency government that will work to save lives and livelihoods of Israeli citizens,” Netanyahu said.

Gantz tweeted: “We prevented fourth elections. We’ll protect democracy. We’ll fight the coronavirus and look out for all Israeli citizens. We have a national emergency government.”

Both Gantz and Netanyahu will serve as vice prime ministers during the other’s premiership in the rotation deal.

The new government will likely have 36 ministers and 16 deputies, marking the largest cabinet in Israel’s history. Likud and Blue and White will be joined by coalition allies Shas, United Torah Judaism and Labor. It was not immediately clear whether the right-wing Yamina party would be in the coalition.

The agreement will be officially signed after Independence Day next week. It upholds much of Netanyahu’s demands, including annexation of the West Bank which is reportedly set to begin as early as July.

Only hours earlier, the unity talks were at a stalemate with Gantz heading to the Knesset to push anti-Netanyahu legislation.

Gantz, as Knesset speaker, threatened to call a plenum vote to advance legislation preventing a prime minister facing corruption charges from serving.

Netanyahu faces three cases of corruption, with fraud, breach of trust and bribery charges.

According to Hebrew-language media reports, the two could not bridge gaps regarding the Judicial Selection Committee, which appoints judges.

Netanyahu is said to have gained the upper hand on the issue, and worked to secure a right-wing majority panel.