Israel's Prime Minister Benjamin Netanyahu has agreed an 11th-hour deal to form a new coalition government.
The agreement, seven weeks after his Likud party won the election, came just before a deadline for the formation of an administration.
Mr Netanyahu needed backing from the right-wing Bayit Yehudi party to give him the necessary 61 seats.
Mr Netanyahu, who first became PM in 1996, is now on course for his fourth term in office.
"I'm sure no-one is surprised that these negotiations were lengthy," Mr Netanyahu told a news conference.
"Time is of the essence, not only because I'm leaving now to call the president and the chairman of the Knesset [parliament] to tell them that I've managed to form a government, but also because we'll need to form it by next week in order to give a strong and stable government."
Majority of one
The leader of Bayit Yehudi (Jewish Home), Naftali Bennett, had demanded the justice ministry in return for support from his eight MPs.
He opposes the establishment of a Palestinian state, enjoys the support of Israeli settler communities in the West Bank and has called for the annexation of parts of the occupied territory.
Bayit Yehudi's backing for settlement expansion could worsen Israel's relations with its ally Washington and with Europe, correspondents say.
Mr Netanyahu had already secured deals by late on Tuesday with three parties - the centrist Kulanu and two ultra-Orthodox parties, United Torah Judaism (UTJ) and Shas.
He now has a majority of just one in the 120-member Knesset and says he will try to enlarge the coalition.
Analysis: Kevin Connolly, BBC News, Jerusalem
In the 67 years of its history, Israel has never known any form of government but multi-party coalition - no-one has ever won an outright parliamentary majority. But rarely can the process have come right down to the wire quite like this.
Benjamin Netanyahu was granted a total of seven weeks to build a new coalition and as the clock ticked towards midnight he had 53 of the 61 seats he needed.
The last eight were in the hands of the Bayit Yehudi party led by Naftali Bennett - once a protege of Mr Netanyahu's and now increasingly a rival for leadership of the Israeli right.
But 61 seats is the bare minimum needed to govern in Israel and a coalition with those numbers won't feel stable. Worse for Mr Netanyahu, Mr Bennett demanded the powerful justice ministry as part of the price for helping the prime minister over the threshold.
For now Israel has its new coalition but it's a government conceived in ill-humour with the narrowest possible parliamentary majority.
Former ally and Foreign Minister Avigdor Lieberman said on Monday that his Yisrael Beitenu party would not join the coalition.
He had complained that the new coalition was not "nationalist" enough.
The coalition agreement came around two hours before the midnight deadline.
Without an accord, President Reuven Rivlin would have offered the chance of forming a government to another party - probably the centre-left opposition Zionist Union, which lost the election despite exit polls predicting a dead heat with Likud.
What the press is saying
Israeli newspaper commentators are broadly unimpressed by the new coalition.
"The fourth Netanyahu government was formed with blood, sweat, and tears - that of Netanyahu and Likud," Yossi Verter writes in Haaretz, while Sima Kadmon ridicules recent events. "A crushing victory in the elections became an unprecedented farce," she says in Yediot Aharonot.
Even Matti Tuchfeld in the pro-Netanyahu Yisrael Hayom predicts that those in seats controlled by the prime minister would fall prey to "blackmail", while Ariela Ringel Hoffman in Yediot Aharonot is damning. "Netanyahu… has a unique talent - to destroy something which, just moments earlier, he built with hard work and sweat."
The Jerusalem Post's Isi Leibler though takes issue with the system, saying "Excoriating Netanyahu for capitulating to unreasonable demands from minority parties that run counter to the will of the people is fine for populist armchair critics. But the responsibility rests with our dysfunctional political system and those voters who supported the small parties."