Prime Minister Benjamin Netanyahu’s government reached a compromise deal on Tuesday evening after a long day of intense talks, apparently solving a coalition crisis that had almost caused early elections to be called.

The Ministerial Committee for Legislation voted unanimously to allow coalition party leaders freedom in instructing their faction how to vote on an ultra-Orthodox-backed bill exempting Haredi students from joining the IDF.

The vote means the compromise deal struck between Netanyahu and two rival coalition partners has apparently been finalized and is now being implemented.

Get The Times of Israel's Daily Edition by email and never miss our top stories Free Sign Up

According to the deal, the conscription bill will pass its first of three votes later this week, before the Knesset goes to its spring recess on Thursday. Meanwhile, the Yisrael Beytenu party’s five lawmakers, who are fiercely opposed to the law, will be permitted to vote against it.

The bill will then be amended according to recommendations to be drafted by the Defense Ministry, and will face its final two votes in the summer. The 2019 state budget will also be approved.

Earlier, senior sources in the coalition were quoted by multiple news outlets as saying Netanyahu had decided not to dismantle the government, having gotten “cold feet.”

Infighting over the bill during the past week has pushed the government to the brink of elections, with parties issuing competing ultimatums over remaining in the coalition.

The ultra-Orthodox have threatened to torpedo the 2019 state budget if the conscription bill does not pass on preliminary reading this week, and Finance Minister Moshe Kahlon has threatened to quit if the budget is not passed.

Some had accused Netanyahu of seeking early elections as a way of clinching another mandate before a possible bribery indictment.

Hebrew-language media reported that the agreement includes voting down an opposition-led motion to dissolve the Knesset and schedule fresh elections, passing the conscription law in preliminary reading while allowing the Yisrael Beytenu party to vote against it. Netanyahu will refrain from firing Yisrael Beytenu Minister Sofa Landver, who on Monday appealed the approval of the law by a ministerial committee.

According to precedent, a sitting minister can’t vote against a government ministerial decision. However, according to the reportedly emerging deal, ministers will request that the prime minister not fire her and guarantee it was a one-time incident.

Liberman on Monday had threatened to quit the coalition and thus usher in new elections if Landver is fired from her ministerial post for opposing the legislation.

But Liberman softened his tone on Tuesday. “If Minister Landver isn’t fired from the government and the defense establishment is allowed the possibility of drafting a new bill that’ll be brought for Knesset approval in the summer session, it’ll be possible to avoid fresh elections,” Liberman wrote on Facebook.

Liberman reiterated that his party would vote against the legislation, which he dubbed the “evasion bill,” and said he has no interest in early elections.

Polls released by Israel’s main news channels Monday night showed Yisrael Beytenu barely squeaking into the Knesset.

While the coalition would retain a two-seat majority if Yisrael Beytenu were to jump ship, Netanyahu has said the government cannot continue with such a slim margin.

While the crisis is ostensibly over the military exemption bill, leaders of coalition parties have insinuated that Netanyahu may be engineering the crisis in order to call early elections as a referendum of sorts on his rule, ahead of a possible indictment.

The prime minister is under investigation in multiple corruption investigations, and facing police recommendations to indict him in at least two cases. He is further embattled by deals signed recently by two of his former confidants that will see them testify against him in a third case.

Netanyahu has denied doing so and repeatedly stressed he has no interest in early elections.

Alexander Fulbright and Raoul Wootliff contributed to this report.