JERUSALEM (AFP) - Israeli Prime Minister Benjamin Netanyahu was on Wednesday locked in a last-ditch effort to piece together a ruling coalition with a working majority ahead of a midnight deadline.
With less than 12 hours left, talks with the far-right Jewish Home - the only potential coalition partner yet to agree to join a Netanyahu government - took on heightened urgency.
If Netanyahu manages to sign the party, as expected, it will give him a razor-thin majority of 61 within the 120-seat Knesset, or parliament.
If he fails, President Reuven Rivlin will ask another party leader to form a government - most likely Isaac Herzog, head of the centre-left Zionist Union, which won 24 seats in the March election.
Netanyahu's success or failure rests in the hands of Jewish Home leader Naftali Bennett, who raised the stakes in the negotiations by demanding ministerial portfolios for all eight of members of his faction.
Without his support, Netanyahu, who began his second term as premier in 2009, will fail and the rightwing religious government he had been hoping to form will never see the light of day.
Although the deadline is midnight (2100 GMT), Netanyahu does not need to present his final lineup but merely inform the president that he has sufficient support to form a government.
The main sticking point has been the justice ministry portfolio which Bennett was demanding but Netanyahu wanted to keep for his rightwing Likud party.
By early afternoon, Netanyahu appeared to have capitulated, Israel's main news outlets said, with the portfolio likely to be given to Ayelet Shaked, number three within Jewish Home.
Bennett had upped his demands on Monday after Foreign Minister Avigdor Lieberman dropped a bombshell by pulling out of the coalition talks, saying his anti-Arab Yisrael Beitenu faction would not join a Netanyahu government.
The move piled pressure on Netanyahu who quickly signed an agreement with the ultra-Orthodox Shas party, leaving only Bennett's party as the last piece in the puzzle.
Despite the bad blood between Netanyahu and Bennett, commentators said the two would eventually reach a last-minute deal.
Weeks after his March 17 election victory, Netanyahu is now being subjected to demands by Bennett, who was his bureau chief between 2006-2008 when he was opposition leader.
"Avigdor Lieberman provoked a rare tizzy in the political establishment two days ago," wrote Ben Caspit in Maariv newspaper.
"Within minutes, Benjamin Netanyahu changed from an all-powerful emperor into a lame duck." Commentators were unanimous that a government with a majority of just 61 would likely be shortlived.
When Netanyahu called for snap elections in December, it was to put an end to the chronic instability in his existing coalition.
When he was tasked with forming a government, Netanyahu said he wanted to form a six-party coalition of rightwing and religious parties which would command a majority of 67.
But Lieberman's last-minute about-face threw a spanner in the works, depriving Netanyahu of six seats and putting Bennett in the role of kingmaker.
So far, Netanyahu's Likud (30 seats) has signed up three parties for a coalition with 53 seats: the centre-right Kulanu (10) and the two ultra-Orthodox parties Shas (seven) and United Torah Judaism (six).
To reach 61, Netanyahu now needs to sign up Jewish Home.
Ayelet Shaked, the Jewish Home MP who will reportedly take the justice ministry, has been at the forefront of efforts to curb the powers of the Supreme Court.
Last year, she tabled a bill which would reduce the court's ability to overturn legislation it finds unconstitutional.
The draft was put together after the court overturned legislation that allowed the state to jail African asylum seekers without trial.
According to her bill, the Knesset could, by a vote of 61 members, reinstate a law that the Supreme Court overturned in a move firmly opposed by Israel's attorney general.
He also spoke out against another piece of draft legislation which would ensure politicians make up a majority on the judicial appointments panel, rather than serving justices.