Benjamin Netanyahu has put himself at the helm of a hardline Israeli government that appears to be on a collision course with the US and other key allies by forming a new coalition.

The prime minister reached a deal with the nationalist Jewish Home party shortly before a midnight deadline, clinching a slim parliamentary majority and averting an embarrassing scenario that would have forced him from office.

But with a government dominated by hardliners who support increased West Bank settlement building and oppose peace moves with the Palestinians, he could have a tough time rallying international support.

Controlling just 61 of 120 parliamentary seats, the narrow coalition could also struggle to press forward with a domestic agenda.

After Mr Netanyahu's Likud Party won elections on March 17 with 30 seats, it seemed he would have a relatively easy time forming a coalition and serving a fourth term as prime minister. But the six-week negotiating process, which expired at midnight, turned out to be much more difficult than anticipated as rival coalition partners and members of Likud jockeyed for influential cabinet ministries.

"I am sure that nobody is surprised that the negotiations continued with all the factions and nobody is surprised it ended at the time it did," Mr Netanyahu said last night.

He vowed to install "a strong and stable government for the people of Israel" by next week, yet also hinted he would court additional partners in the near future.

"Sixty-one is a good number, and 61-plus is an even better number," he said. "But it starts at 61 and we will begin. We have a lot of work ahead of us."

The coalition talks stalled this week when foreign minister Avigdor Lieberman, a long-time political partner of Mr Netanyahu, unexpectedly stepped down and announced his secular nationalist Yisrael Beitenu party was joining the opposition.

That left Mr Netanyahu dependent on Jewish Home leader Naftali Bennett, a former aide with whom he has a rocky relationship. With Mr Bennett driving a hard bargain, the talks stretched throughout the day and well into the night before Mr Netanyahu called President Reuven Rivlin, as required by law, to announce the deal.

Mr Netanyahu had until midnight to speak to Mr Rivlin, otherwise the president would have been required to ask another politician to try to form a government.

But analysts do not expect the new government to last long or accomplish much.

Opposition leader Isaac Herzog, head of the centrist Zionist Union, called the coalition "a national failure government", an "embarrassing farce" and "the narrowest in Israel's history".

During the campaign, Mr Netanyahu angered the White House when he said that he would not allow the establishment of a Palestinian state on his watch.

Although he has tried to backtrack, the White House has reacted with scepticism. Mr Netanyahu's Likud Party is dominated by hardliners opposed to Palestinian independence, a position that is shared by Jewish Home. The odds of peace talks restarting, much less making any progress, appear slim.

Jewish Home's close ties with the settler movement mean that there will probably be great pressure on the new government to expand building on occupied lands.

The international community overwhelmingly opposes settlement construction and the Palestinians are trying to push forward with a war crimes case against the settlements at the International Criminal Court in the Hague.

US officials have said they could have a hard time defending Israeli policies if the government is not committed to a two-state solution with the Palestinians.

The new government could also struggle at home. Under the coalition deal, Jewish Home gained control of the influential education and justice ministries. The incoming justice minister, Ayelet Shaked, is an outspoken critic of the country's judiciary and is expected to seek a greater voice in the appointment of judges.

Meanwhile, Mr Netanyahu's ultra-Orthodox partners, Shas and United Torah Judaism, are bent on reversing reforms passed by the last government.

Those reforms sought to end an unpopular system that granted the ultra-Orthodox exemptions from compulsory military service, welfare subsidies to study full time instead of entering the workforce and generous budgets for a religious school system that largely ignores key subjects like maths, English and computer studies.

These long-standing benefits have bred widespread resentment among the secular majority. Wiping out the reforms is likely to generate renewed public anger.

Yair Lapid, whose Yesh Atid party spearheaded the outgoing government's reforms, said there was little to celebrate Wednesday night.

"A narrow, suspicious and sectoral government is on its way," he said, vowing to "do everything" to stop "the clearance sale of the country" to parties with narrow interests.

Mr Netanyahu's last partner, Kulanu, is a centrist party focused on bringing relief to Israel's struggling middle class. Although in control of the Finance Ministry, the party could struggle passing reforms due to the slim parliamentary majority.