Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

After three inconclusive elections held within the span of a year, Israeli political rivals Benjamin Netanyahu and Benny Gantz broke a persistent political deadlock and announced Monday they had reached an agreement to form a unity government that will keep Netanyahu in office until October 2021.

"At this time, an agreement was signed for the establishment of a national emergency government between Prime Minister Benjamin Netanyahu and Blue and White Chairman, Maj. Gen. (res.) MK Benny Gantz," Netanyahu's Likud party said in a tweet.

Netanyahu will serve first as prime minister, with Gantz taking over the reins in October 2021, Likud and the Blue and White party announced in a joint statement on Monday. In the meantime, Gantz will serve as deputy prime minister.

The agreement will cement Netanyahu's reputation as a political magician who once again has managed to cling to power in spite of adverse circumstances. In November, Netanyahu was indicted on charges of bribery, fraud and breach of trust. He denies any wrongdoing.

"I promised the State of Israel a national emergency government that would work to save the lives and livelihoods of Israeli citizens," he tweeted after the announcement of the agreement on Monday. "I will continue to do everything for you citizens of Israel."

Leader of Israel's Blue and White electoral alliance Benny Gantz became speak of the Knesset on Thursday. Ahmad Gharabli / AFP - Getty Images

Once formed, the government will be defined as a national emergency government for a period of six months and no legislation unrelated to the battle against the coronavirus will be brought in parliament, "without consent," according to the joint statement.

From July the prime minister would be able to bring parts of President Donald Trump's Mideast peace plan regarding the annexation of parts of the West Bank, to parliament, the statement added.

In January, Trump released a long-promised Middle East peace plan that, if implemented, would create a conditional path to statehood for Palestinians while recognizing Israeli sovereignty over a significant portion of the occupied West Bank. Trump said the longshot plan, which lacks Palestinian support, would require both sides to make concessions.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

Extending sovereignty to parts of the West Bank became a key priority of Netanyahu as he struggled to maintain his grip on power.

The finance, health and interior ministries will be among those held by Likud and their partners, while Blue and White and their partners will control the defense, foreign affairs and justice ministries, the statement added.

Yousef Jabareen, a lawmaker and member of the Joint List coalition of Arab parties in Israel's parliament, said it was clear Netanyahu remains in control of the unity government and guides its vision.

"It will deepen Israel’s military rule over Palestinians in the occupied territories and likely begin the process of annexing Israel’s illegal settlements built on stolen Palestinian land," he said.

The announcement comes after Gantz was voted in as the speaker of the Knesset, Israel's parliament, on March 26.

"These are unusual times and they call for unusual decisions," Gantz, who nominated himself for the role as speaker, said after the vote last month which paved the way for an agreement between the two camps to be reached.

However, the move has also cost him the unity of his centrist Blue and White alliance, an umbrella group compromised of three smaller parties, that has battled to take power from Netanyahu's right-wing Likud party in the last three elections.

The latest nation-wide vote held on March 2 saw neither Likud nor Blue and White capturing enough seats to form a majority government even with the backing of smaller parties.

Blue and White’s co-leaders Yair Lapid and Moshe Ya’alon filed a request to split from the rest of the alliance in the Knesset moments before the vote on Gantz’s nomination as speaker last month.

“Benny Gantz decided today to break apart Blue and White in order to crawl into Netanyahu’s government. It’s a disappointing decision," Lapid said.

Blue and White had intended to nominate another lawmaker as speaker, who was part of a different faction of the alliance, and to use the position to push for legislation that would prevent an indicted lawmaker from becoming prime minister.

But Likud hit back saying if Blue and White pursued this approach it would put an end to any discussions to form a unity government between the two camps — a move that could have seen Israel dragged into an unpopular fourth election. It was announced Monday that under the agreement the role of speaker would go to Likud.

The political crisis in Israel has persisted even as the country tackles the outbreak of the contagious coronavirus that is afflicting much of the world. As of Monday, Israel had recorded more than 13,600 cases of the virus as well as 174 deaths.

The stakes are particularly high for Netanyahu who was meant to go on trial for his corruption charges last month but managed to postpone his court date due to the outbreak.

Netanyahu, who is Israel’s longest serving prime minister, faces up to 10 years in prison if convicted of bribery and a maximum 3-year term for fraud and breach of trust, according to legal experts.

He has denied any wrongdoing and said he is the victim of a "witch hunt."