Prime Minister Benjamin Netanyahu managed to secure the missing seats needed for a coalition on Wednesday night, winning over Bayit Yehudi with less than two hours to spare as the clock ticks down on his timeframe for forming the government.
Netanyahu effectively caved in to all of Bayit Yehudi's demands, including naming MK Ayelet Shaked as justice minister, with almost all of the powers and authorities that the Likud had initially tried to curtail.
Bayit Yehudi leader Naftali Bennett will be made education minister, after giving up his previous demands for the Foreign or Defense Ministries. In addition, outgoing Construction Minister Uri Ariel will serve as agriculture minister in the new government.
Netanyahu and Bennett announced their coalition deal on Wednesday night, with the Bayit Yehudi leader committing to join the government, but have yet to sign the deal in order to give Bennett 24 hours to iron out final details.
"Finally, there's a government in Israel," Bennett said at a late-night press conference. "This isn't a right-wing government, it isn't a left-wing government, and it isn't a center government. It's a government of the entire nation of Israel."
"I want to tell you, Mr. Prime Minister, we are behind you," Bennett added. "We will help and aid you for the success of the government under your leadership."
"I'm sure no one is surprised of the fact these negotiations continued with all of the factions, and no one was surprised that it ended on time," Netanyahu said.
"I said before that 61 was a good number, but 61 plus is an even better number. There's still a lot of work left to all of us. Good luck to us and to the people of Israel," the prime minister added.
After the press conference, Netanyahu called President Reuven Rivlin to tell the president he was successful in forming a government. The prime minister now has exactly a week to swear in his government.
The battle for the Justice Ministry
In a last minute move on Tuesday night, Bayit Yehudi demanded Shaked is appointmented as justice minister.
Netanyahu agreed to the demand, on condition that Shaked not head the committee overseeing the nomination of new judges, does not have the authority to appoint rabbinical judges and does not head the Ministerial Committee for Legislation - three roles traditionally tasked to the justice minister.
But as the clock ticked down to the midnight deadline on Wednesday, Netanyahu had no choice but to agree to leave two of the three roles in the hands of the justice minister - authority over the Judicial Selection Committee and the Ministerial Committee for Legislation.
In addition to the education, justice and agriculture portfolios, Bayit Yehudi will receive control over the Settlement Division and the Knesset's Constitution, Law and Justice Committee and one of its MKs will be appointed deputy defense minister.
Bennett also secured a commitment to implement the Prawer Plan on the arrangement of Bedouin settlement in the Negev.
Bayit Yehudi is expected to demand Shaked to be sworn in as minister in the first round of ministerial appointments, before the expansion of the government. This first round is expected to take place in the Knesset on Monday.
After that, the battle for the remaining ministries will begin in the Likud party, with some saying that due to Netanyahu's generosity to its coalition partners, he will have to appoint more ministers from his own party than he had initially planned.
Bayit Yehudi was the last remaining key to the formation of the fourth Netanyahu government. The coalition will comprise just 61 MKs - Likud's 30, Kulanu's 10, Bayit Yehudi's 8, Shas' 7 and United Torah Judaism's 6.
From the start of negotiations, Bennett has had his eye on either the Defense or Foreign Ministry, but changed his demand to the education portfolio when he realized that he would not receive either of the two senior posts. The Finance Ministry was promised long ago to Kulanu leader Moshe Kahlon, a former Likud minister who left under a cloud to form his own party.
But Yisrael Beytenu leader Avigdor Lieberman's decision not to join the next government and to resign his post at the Foreign Ministry, has left the job open and Netanyahu desperate to muster the number of MKs needed to form a government. Bennett then toughened his demands, requesting the Justice Ministry for Shaked and a guarantee that Zionist Union would not be brought in. Only one of his demands - Shaked's position - was met.