Israeli Prime Minister Benjamin Netanyahu and his former rival Benny Gantz signed a deal on Monday to form a “national emergency government,” ending more than a year of political deadlock in which Israel was forced to hold three elections.

Why it matters: Facing corruption charges and protests, Netanyahu will remain in office as prime minister — just weeks after it seemed like his political career was over. Netanyahu's trial has been postponed until May 24 as a result of the coronavirus crisis.

The agreement culminates a stunning about-face by Gantz, the leader of the centrist Blue and White party who campaigned on ousting Netanyahu from office.

It also means Israel will avoid going to the polls for a fourth election.

Details: According to the coalition deal, both Netanyahu and Gantz will be sworn in together as prime minister and prime minister-designate. Netanyahu will serve for 18 months as prime minister, followed by 18 months for Gantz.

The deal also says Netanyahu can bring "the understandings with the Trump administration" on annexing parts of the West Bank to a discussion in the Cabinet, and to a vote either in the Cabinet or in the Knesset starting from July 1.

Netanyahu and Gantz will work "in full agreement with the U.S." regarding the Trump administration's peace plan, including on the issue of mapping the parts of the West Bank that the U.S. is ready to recognize as part of Israel.

The deal also says Netanyahu and Gantz will "engage in dialogue” with the international community on the issue of annexation “with the aim of preserving the security and strategic interests of Israel including maintaining regional stability, preserving existing peace agreements and working towards future peace agreements."

Between the lines: Netanyahu’s wish to annex the Jordan Valley and other parts of the occupied West Bank was one of the main sticking points in negotiations on the new government.

Gantz gave up on his demand to have a veto power over any decision on annexation. This issue is the only one in the coalition deal that Gantz doesn’t have veto power on.

The big picture: Netanyahu sees the potential annexation of parts of the West Bank as his main legacy as prime minister of Israel.

According to his aides, he wants to implement it well before the U.S. elections in November, fearing President Trump might lose and the move will not be possible if Joe Biden is in the White House.

What’s next: It's unclear whether the Trump administration will be able to seriously discuss the issue of annexation with the new Israeli government in the next few months, considering much of its focus remains on the coronavirus crisis.