But with a knife-edge majority of just one seat in the 120-member parliament expectations were that he would have to expand the ruling alliance beyond his natural religious and rightist partners or battle for survival at every vote.
"I am leaving here to call the president and the speaker of the parliament to inform them that I have been able to build a government," he said in remarks at the Knesset after marathon talks with Jewish Home leader Naftali Bennett.
"We need to launch it next week and we shall do so," he added.
President Reuven Rivlin's office said he had sent a written note followed up with a phone call.
"I am honoured to inform you that I have been successful in forming a government, which I will request is brought before the Knesset for its approval as soon as possible," Rivlin's office quoted the note as saying.
"The negotiations are over," Bennett said on his official Twitter account, adding, "Now we get to work."
The news came just over an hour ahead of a legal deadline at midnight (2100 GMT) after which the task of forming a government would have been given to another party leader -- most likely Isaac Herzog, head of the centre-left Zionist Union, which won 24 seats in the March 17 election, behind 30 for Netanyahu's rightwing Likud.
The deal with Bennett leaves Netanyahu in command of 61 Knesset votes, bought at the cost of major concessions to his partners.
Analysts say he will be at the mercy of rebels, caprice, or even a bad cold the first time the coalition faces a crucial vote.
He would then be forced to expand the ruling alliance beyond his natural religious and rightist partners and turn reluctantly to the Zionist Union, which has so far said it will sit in opposition.
"Netanyahu is left with an unmanageable situation," said political scientist Emmanuel Navon, of Tel Aviv University.
"The first thing he'll do tomorrow... is take his phone and start working on a coalition with (the Zionist Union)," he told AFP.
Netanyahu, "is a general without soldiers," the Maariv daily wrote.
Netanyahu himself said he hoped to expand the alliance, without elaborating.
"I have said that 61 is a good number and 61-plus is better still, but it starts at 61," he said in his Knesset remarks.
Signup to our newsletter and follow us on Facebook and Twitter!
For the time being his right-religious government is expected to continue his robust foreign policy -- marked by virulent attacks on Iran -- and to maintain a hard line on the issue of concessions to the Palestinians.
- 'Emperor to lame duck' -
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.
Lieberman said in a statement Wednesday that it was his last day on the job.
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.
"Avigdor Lieberman provoked a rare tizzy in the political establishment two days ago," wrote Ben Caspit in Maariv.
"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 short-lived.
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 deprived Netanyahu of six seats and put Bennett in the role of kingmaker.
Likud had previously signed up three parties: the centre-right Kulanu (10 seats) and the two ultra-Orthodox parties Shas (seven) and United Torah Judaism (six).
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.