Israeli Prime Minister Benjamin Netanyahu’s government agreed on Wednesday to hold early elections on April 9 after the ruling coalition appeared to come up short on votes needed to pass a contentious piece of court-ordered legislation, Israel media has reported.

Mr Netanyahu’s religious, nationalistic coalition has been roiled by internal divisions for months.

Avigdor Lieberman resigned as defence minister last month to protest what he perceived to be the government’s weak response to rocket attacks from Hamas-ruled Gaza.

But a new law extending the military draft to ultra-Orthodox men appears to have triggered the government’s downfall.

Mr Netanyahu’s ultra-Orthodox partners are demanding the legislation be weakened and his razor-thin parliamentary majority seems to be making such a compromise impossible.

Ultra-Orthodox parties consider conscription a taboo, fearing that military service will lead to immersion in secularism.

But years of exemptions have generated widespread resentment among the rest of Jewish Israelis.

Earlier on Wednesday, Yair Lapid of the opposition Yesh Atid party announced he was rescinding his support for the bill, calling the coalition’s hoped-for compromise a pay-off to draft dodgers.

As a result, Mr Netanyahu convened his fellow coalition faction leaders and the decision was made to dissolve parliament and go to elections.

The latest polls appear to predict another solid victory for Mr Netanyahu, one that would assure his place in history as Israel’s longest-serving leader and allow him to solidify his close alliance with US President Donald Trump.

Another term would also allow Mr Netanyahu to push forward with his nationalistic agenda and worldwide campaign to thwart Iran’s nuclear ambitions.

But one big obstacle could still trip him up: a mounting corruption investigation that may soon deliver criminal charges.

Elections were previously scheduled for November 2019.

The last time an Israeli government served its full term was in 1988. Since then, elections have almost always been moved up because of a coalition crisis or as a strategic move by the prime minister to maximise his chance of re-election.