After six arduous weeks of back-and-forth negotiations, spin, counter-spin, secret meetings and bleary-eyed all-nighters — and then some more spin — white smoke has finally emerged from the Prime Minister’s Residence on Jerusalem’s Balfour Street: Habemus coalition, we have a government.

It was a close call for Prime Minister Benjamin Netanyahu. And although he could have held out a bit longer — he only has to inform President Shimon Peres about his coalition by Saturday night or forfeit the privilege to build the government — he didn’t take the risk. Yesh Atid head Yair Lapid stood his ground and guaranteed the education portfolio for his No. 2, Rabbi Shai Piron. Netanyahu really wanted to save the prestigious post for the incumbent, Gideon Sa’ar, who came in second in the Likud party primaries, but Lapid won out.

With near-divine timing for the fraternal Jewish state and the Catholic church, the final compromise was pushed through in Jerusalem just as the white smoke emerged in Vatican City.

It was a bloody battle, and Yesh Atid lost some of that “new politics” sheen it enjoyed post-election, but Lapid can be satisfied with his accomplishments. Heading the second-largest force in the 19th Knesset, he started out from a position of power; still, for a political greenhorn fighting against the battle-tested Netanyahu, he was able to walk away with considerable gains.

True, Lapid dreamed of the Foreign Ministry, a position that would have undoubtedly raised his popularity more than the Treasury, where he will likely have to sign off on painful cuts. But after asking “Where is the money?” throughout the campaign, he realized he couldn’t dodge the bullet that Netanyahu was sending his way.

Yes, in terms of Lapid’s plan to succeed Netanyahu as prime minister in the next elections, it would have been better for him to travel the world and smile into cameras in Paris, London and at the UN; certainly more than serving as finance minister — especially one who not too many years ago admitted to that very same Netanyahu that he doesn’t “understand a thing about economics.”

But you can’t have everything. Vice prime minister and finance minister Lapid will have few international photo-ops to raise his public profile and hone his foreign policy bona fides. But that pales when compared to the fact that he succeeded in breaking apart two “natural partners” — Netanyahu and the Haredi parties — and was thus able to potentially set the domestic agenda for the new government.

One of the implications is that the 33rd government will pass a new conscription law that will do away with the blanket draft exemptions for yeshiva students. Will it change the face of the Israeli military for the better? Will it pave the way for the ultra-Orthodox to join the workforce, ending widespread poverty in their communities? The devil will be in the details. Lapid, partnered by his ally Naftali Bennett, has enabled the attempt.

Yesh Atid’s second most important achievement is a streamlining of government. Only 21 ministers (not including the prime minister) — that’s about a third less than the previous cabinet. And for the first time since 1951, there will be no ministers without portfolios. That might sound trifling, but during the last four years, NIS 400 million (over $100 million) from the state’s coffers were spent on secretaries, spokespeople, assistants, drivers and other operational budgets for ministers who don’t do much other than be ministers. Will this reform rescue Israel from its financial and bureaucratic woes? Surely not. But it’s a step in the right direction. And a good signal to the rest of the nation.

“The size of the cabinet is not the most important for the existence and prosperity of the state. But in a world of images and symbols… size matters — boy does it matter,” veteran political commentator Yossi Verter wrote in Haaretz earlier this week, calling Lapid’s perseverance in the struggle for a smaller government “an enormous victory.”

The coalition agreement also reportedly includes a clause that would double the minimum threshold for a party’s election to Knesset to four percent of the vote, a step that, it is hoped, will ensure more political stability.

The second winner of the coalition-building bickering is Jewish Home party chairman Bennett. For one thing, it was his mediation effort that broke the deadlock between Yesh Atid and Likud on Wednesday, making him look like the responsible adult arbitrating an argument between two immature children.

He is also walking away with three ministries, two of which have a lot of potential: If economics and trade minister Bennett manages to significantly reduce the cost of living, a goal he pledged to spend all his energy pursuing, the subsequent boost in popularity would make him a realistic contender, after Lapid, for the premiership in time for the next elections. And as housing and construction minister, who also controls the Israel Land Administration, colleague Uri Ariel holds one of the most important keys to settlement building. What else could the rightist party wish for?

The prime minister, on the other hand, stands severely weakened. Besides forcing the unpopular Finance Ministry on Lapid (thus saving the Foreign Ministry for his ally Avigdor Liberman), Netanyahu’s only success was having managed to maintain a majority of ministers from his own party and its partner, Liberman’s Yisrael Beytenu, around the cabinet table.

But the government he finally cobbled together will not make his life easy. To his left sits Tzipi Livni, who dreams of signing a peace deal with the Palestinians today rather than tomorrow. To his right grins Bennett, his disgruntled former bureau chief and soon-to-be deputy prime minister, who dreams of annexing the West Bank. Netanyahu will also have to face daunting challenges from within his own faction, specifically from disgruntled former Knesset speaker Reuven Rivlin (who will be replaced by Netanyahu loyalist Yuli Edelstein) and a number of up-and-coming-yet-frustrated young MKs who had harbored (and broadcasted) hopes to become ministers. Some former ministers may find themselves in the cold, too, and they won’t make a secret of their unhappiness.

The election campaign focused on socioeconomic issues, all but ignoring diplomatic concerns. As soon as the white smoke above the Prime Minister’s Residence on Jerusalem’s Balfour Street clears, the real work will begin.

Initially, at least, the 33rd Israeli government’s greatest achievements can be solely of a domestic nature. As President Barack Obama will likely confirm for himself next week, anyone expecting that this government, with these conflicted components, will be able to make significant progress on regional issues, such as the diplomatic process with the Palestinians, should think again.