Negotiations over forming Israel’s next governing coalition are appearing to go down to the wire as a Wednesday-night deadline and potential elections loom.

“Until midnight tomorrow, the mandate for forming the government is in the hands of Prime Minister Benjamin Netanyahu,” Israeli President Reuven Rivlin’s office said in a statement on Tuesday. “The president will allow him to exhaust the time granted him by law while hoping that we won’t, heaven forbid, be caught up in another election campaign.”

Netanyahu negotiations over a governing coalition have been stymied by former defense minister and Yisrael Beiteinu Party leader Avigdor Lieberman, whose party won just five seats, has said that he backs Netanyahu as prime minister, but will only join the government if there is a commitment to pass a bill regulating the military draft among the ultra-Orthodox. The draft bill, which was crafted in the last Knesset, is strongly opposed by two ultra-Orthodox parties, Shas and United Torah Judaism, who each won eight seats in the elections.

Lieberman, whose party draws support from Israel’s largely secular Russian immigrant community, has doubled down on his key demand and has accused the ultra-Orthodox parties of “extremism.”

“Yisrael Beiteinu’s only motivation is to uphold the commitments made to the public before the elections,” Lieberman said in a statement on Tuesday. “We aren’t looking to topple Netanyahu … but we’re also not willing to compromise our principles.”

At the same time, Netanyahu and Lieberman also have a long and acrimonious history, with Lieberman dropping out of Netanyahu’s previous government last December over the prime minister’s handling of Hamas rocket fire from the Gaza Strip.

As the deadline to form the next government looms, Netanyahu did ink an agreement with former finance minister Moshe Kahlon for his center-right party, Kulanu, to merge with Likud. Kulanu, which won four seats in the election, would see its members receive four slots in Likud’s party list, with Kahlon getting the fifth spot.

“We will all continue serving as a socioeconomic, nationalist right-wing party,” Kahlon said in a statement.

Meanwhile, Blue and White Party leader Benny Gantz, whose party won 35 seats in the April 10 election, criticized Netanyahu’s handling of coalition negotiations, while blaming the Israeli leader’s legal woes as the reason for the impasse.

“Bibi could have stepped down and tomorrow there would be a functioning government here,” Gantz said in a tweet, referring to Netanyahu’s nickname. “But that is how it is when everything serves the legal fortress, when the benefit of the citizen is always a minor consideration.”