An unlikely coalition prevailed against the country’s longest-serving leader. Now it must get its disparate factions to work together.JERUSALEM — The long and divisive reign of Benjamin Netanyahu, the dominant Israeli politician of the past generation, officially ended on Sunday night, at least for the time being, as the country’s Parliament gave its vote of confidence to a precarious coalition government stitched together by widely disparate anti-Netanyahu forces.Naftali Bennett, a 49-year-old former aide to Mr. Netanyahu who opposes a Palestinian state and is considered to the right of his old ally, replaced him as prime minister after winning by just a single vote. Yair Lapid, a centrist leader and the new foreign minister, is set to take Mr. Bennett’s place after two years, if their government can hold together that long.They lead a fragile eight-party alliance ranging from far left to hard right, from secular to religious, that few expect to last a full term and many consider both the embodiment of the rich diversity of Israeli society but also the epitome of its political disarray.Members of the bloc agree on little but a desire to oust Mr. Netanyahu, the longest-serving leader in the country’s history, and the need to end a lengthy political gridlock that produced four elections in two years; left Israel without a stable government or a state budget; and formed the backdrop to a surge in interethnic mob violence between Jewish and Arab citizens during the recent 11-day conflict with Hamas.“We stopped the train before the abyss,” Mr. Bennett said in a speech to Parliament on Sunday. “The time has come for different leaders, from all parts of the people, to stop — to stop this madness.”Mr. Netanyahu’s departure marks the end of a tenure in which he shaped 21st-century Israel more than any other figure, and largely turned Israeli politics into a referendum on a single issue — his own character.During 15 years in power, the last 12 of them uninterrupted, Mr. Netanyahu helped shift Israel further to the right and presided over the dwindling of Israeli-Palestinian peace negotiations, collapsing hopes of a two-state resolution to the conflict. He was also accused of undermining the rule of law by staying in office while standing trial for corruption. It was a decision that divided the Israeli right and contributed to Mr. Bennett’s decision to side with Mr. Netanyahu’s opponents.Mr. Netanyahu, 71, simultaneously scored several diplomatic triumphs, including agreements with four Arab countries that upended assumptions that Israel would only normalize relations with the Arab world after it sealed peace with the Palestinians.In a combative speech on Sunday to Parliament, Mr. Netanyahu vowed to stay at the helm of his party, Likud, leading opposition to a new government that he portrayed as a leftist threat to Israeli security.Prime Minister Benjamin Netanyahu speaking before the vote on Sunday.Dan Balilty for The New York Times“I say today: Do not let your spirits fall,” Mr. Netanyahu told his allies in Parliament. “I will lead you in a daily battle against this bad and dangerous left-wing government, and bring it down. And with the help of God, this will happen faster than you think.”Israel’s Parliament, the Knesset, approved the new government by the slimmest of margins — the vote was 60 to 59. In a sign of challenges to come, one lawmaker who had originally agreed to support the coalition balked at the 11th hour, deciding to abstain instead of voting in its favor. To ensure the coalition’s victory, a second lawmaker left a hospital to vote — and then returned to her hospital bed.Analysts predict that the new Israeli government will focus on restoring Israel’s traditional approach of seeking bipartisan American support, after years of tension with American Democrats.In a statement, Mr. Biden said: “I look forward to working with Prime Minister Bennett to strengthen all aspects of the close and enduring relationship between our two nations.”“Thank you Mr. President!” Mr. Bennett replied on Twitter. “I look forward to working with you to strengthen the ties between our two nations.”In his earlier speech to Parliament, however, Mr. Bennett hinted at disagreements to come, promising to continue Israel’s opposition to forging a new nuclear deal with Iran. But he also thanked Mr. Biden for his support for Israel. The pair later spoke by phone, Mr. Bennett’s office said, while Mr. Lapid spoke with Secretary of State Antony J. Blinken.The new government was installed following a rancorous parliamentary debate that embodied the bitterness that came to define political discourse in the Netanyahu era.During his speech, Mr. Bennett was frequently interrupted and heckled by right-wing opponents. They view Mr. Bennett, a hard-right former settler leader, as a traitor for breaking with Mr. Netanyahu and allying with a coalition that includes leftists, centrists and, for the first time ever, an independent party run by Palestinian citizens of Israel.Mansour Abbas of the Raam Party at the Knesset before the vote.Dan Balilty for The New York TimesAt least four allies of Mr. Netanyahu were thrown out of the session by the speaker, Yariv Levin, while a fifth walked out voluntarily.“You should be embarrassed!” shouted David Amsalem, a Likud lawmaker, during Mr. Bennett’s speech.Mr. Bennett attempted to turn those interjections into an illustration of why he had decided to part ways with Mr. Netanyahu’s right-wing bloc in the first place.“There are points in Jewish history where disagreements got out of control,” Mr. Bennett said. “Twice in history we lost our national home exactly because the leaders of that generation were unable to sit together and compromise.”But amid the acrimony, there were also moments of unity and empathy across party lines.After Mr. Levin, the speaker, was replaced in a separate vote by Mickey Levy, an ally of Mr. Lapid, the two embraced for several seconds. Earlier, ultra-Orthodox lawmakers laughed amiably along with jokes by Merav Michaeli, a staunch secularist and critic of Mr. Netanyahu — barely an hour after they had hurled insults at Mr. Bennett, her new coalition partner.Until the day of the vote, and even on it, Mr. Netanyahu and his right-wing allies labored hard to break the alliance before it could take office. They applied intense pressure on right-wing opposition lawmakers, urging them to peel away from their leaders and refuse to support a coalition that they claimed would ruin the country. For most of this month, supporters of Mr. Netanyahu picketed the homes of Mr. Bennett and his lawmakers, screaming abuse as they came past.Mr. Netanyahu’s departure was a watershed moment for politics in Israel. He had been in power for so long that he was the only prime minister that many young adults could remember. For many, he had grown synonymous not only with the Israeli state, but also with the concept of Israeli security — and an Israel without him seemed almost inconceivable to some.In Tel Aviv, ecstatic Netanayhu opponents descended onto Rabin Square for an impromptu celebration. As music blasted, Israelis of all ages crowded in carrying the national flag, rainbow flags and pink flags, the color adopted by members of the movement to oust the prime minister..css-1xzcza9{list-style-type:disc;padding-inline-start:1em;}.css-3btd0c{font-family:nyt-franklin,helvetica,arial,sans-serif;font-size:1rem;line-height:1.375rem;color:#333;margin-bottom:0.78125rem;}@media (min-width:740px){.css-3btd0c{font-size:1.0625rem;line-height:1.5rem;margin-bottom:0.9375rem;}}.css-3btd0c strong{font-weight:600;}.css-3btd0c em{font-style:italic;}.css-w739ur{margin:0 auto 5px;font-family:nyt-franklin,helvetica,arial,sans-serif;font-weight:700;font-size:1.125rem;line-height:1.3125rem;color:#121212;}#NYT_BELOW_MAIN_CONTENT_REGION .css-w739ur{font-family:nyt-cheltenham,georgia,’times new roman’,times,serif;font-weight:700;font-size:1.375rem;line-height:1.625rem;}@media (min-width:740px){#NYT_BELOW_MAIN_CONTENT_REGION .css-w739ur{font-size:1.6875rem;line-height:1.875rem;}}@media (min-width:740px){.css-w739ur{font-size:1.25rem;line-height:1.4375rem;}}.css-9s9ecg{margin-bottom:15px;}.css-16ed7iq{width:100%;display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;-webkit-box-pack:center;-webkit-justify-content:center;-ms-flex-pack:center;justify-content:center;padding:10px 0;background-color:white;}.css-pmm6ed{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-align-items:center;-webkit-box-align:center;-ms-flex-align:center;align-items:center;}.css-pmm6ed > :not(:first-child){margin-left:5px;}.css-5gimkt{font-family:nyt-franklin,helvetica,arial,sans-serif;font-size:0.8125rem;font-weight:700;-webkit-letter-spacing:0.03em;-moz-letter-spacing:0.03em;-ms-letter-spacing:0.03em;letter-spacing:0.03em;text-transform:uppercase;color:#333;}.css-5gimkt:after{content:’Collapse’;}.css-rdoyk0{-webkit-transition:all 0.5s ease;transition:all 0.5s ease;-webkit-transform:rotate(180deg);-ms-transform:rotate(180deg);transform:rotate(180deg);}.css-eb027h{max-height:5000px;-webkit-transition:max-height 0.5s ease;transition:max-height 0.5s ease;}.css-6mllg9{-webkit-transition:all 0.5s ease;transition:all 0.5s ease;position:relative;opacity:0;}.css-6mllg9:before{content:”;background-image:linear-gradient(180deg,transparent,#ffffff);background-image:-webkit-linear-gradient(270deg,rgba(255,255,255,0),#ffffff);height:80px;width:100%;position:absolute;bottom:0px;pointer-events:none;}.css-uf1ume{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-box-pack:justify;-webkit-justify-content:space-between;-ms-flex-pack:justify;justify-content:space-between;}.css-wxi1cx{display:-webkit-box;display:-webkit-flex;display:-ms-flexbox;display:flex;-webkit-flex-direction:column;-ms-flex-direction:column;flex-direction:column;-webkit-align-self:flex-end;-ms-flex-item-align:end;align-self:flex-end;}.css-12vbvwq{background-color:white;border:1px solid #e2e2e2;width:calc(100% – 40px);max-width:600px;margin:1.5rem auto 1.9rem;padding:15px;box-sizing:border-box;}@media (min-width:740px){.css-12vbvwq{padding:20px;width:100%;}}.css-12vbvwq:focus{outline:1px solid #e2e2e2;}#NYT_BELOW_MAIN_CONTENT_REGION .css-12vbvwq{border:none;padding:10px 0 0;border-top:2px solid #121212;}.css-12vbvwq[data-truncated] .css-rdoyk0{-webkit-transform:rotate(0deg);-ms-transform:rotate(0deg);transform:rotate(0deg);}.css-12vbvwq[data-truncated] .css-eb027h{max-height:300px;overflow:hidden;-webkit-transition:none;transition:none;}.css-12vbvwq[data-truncated] .css-5gimkt:after{content:’See more’;}.css-12vbvwq[data-truncated] .css-6mllg9{opacity:1;}.css-qjk116{margin:0 auto;overflow:hidden;}.css-qjk116 strong{font-weight:700;}.css-qjk116 em{font-style:italic;}.css-qjk116 a{color:#326891;-webkit-text-decoration:underline;text-decoration:underline;text-underline-offset:1px;-webkit-text-decoration-thickness:1px;text-decoration-thickness:1px;-webkit-text-decoration-color:#326891;text-decoration-color:#326891;}.css-qjk116 a:visited{color:#326891;-webkit-text-decoration-color:#326891;text-decoration-color:#326891;}.css-qjk116 a:hover{-webkit-text-decoration:none;text-decoration:none;}One celebrant, Shoval Sadde, expressed relief that the coalition had come together after weeks of uncertainty.“Today is final,” she said. “There are no secret magics anymore that Bibi can pull out of a hat. It’s final.”For supporters of Bibi, as Mr. Netanyahu is universally known in Israel, his exit was devastating and unsettling.“We are here in pain,” said Ronni Shabtai, a right-wing activist who joined a rally outside Mr. Netanyahu’s official residence after the vote. “Bibi is a prime minister born once in a generation, and a king in our time.”Likud Party supporters demonstrating outside Mr. Netanyahu’s home on Sunday night.Amit Elkayam for The New York TimesGiven Mr. Netanyahu’s record as a shrewd political operator who has defied many previous predictions of his political demise, few Israelis are writing off his career.Even out of government and standing trial on corruption charges, he remains a formidable force who will probably try to drive wedges between the coalition parties. He remains the leader of the parliamentary opposition and a cagey tactician, with a sizable following and powerful allies.Mr. Netanyahu’s current predicament stems largely from his decision to remain in office even after being investigated for corruption in 2017, and later put on trial. That led to a rift among his supporters — and, more generally, divided voters less by their political views than by their attitudes to Mr. Netanyahu himself. The result was four early elections over two years, each of which failed to return a clear winner.Through it all, Mr. Netanyahu remained in office, for much of it only as a caretaker, stoking divisions and demonizing his opponents.The new coalition proposes to set aside some of the toughest issues and focus on rebuilding the economy and infrastructure. Many supporters hope to see movement away from the social policies promoted by the ultra-Orthodox minority, whose parties were allied with Mr. Netanyahu. But it remains to be seen whether the new government will avoid another gridlock or crumble under its own contradictions.Mr. Bennett’s religious Zionist party, Yamina, supports annexation of large parts of the West Bank and vehemently opposes Palestinian statehood, positions antithetical to some of its governing partners. In the March 23 election, it won just seven of the Knesset’s 120 seats, making it the smallest faction ever to hold the premiership.Mr. Bennett, right, with Mr. Lapid and the defense minister, Benny Gantz, in the Knesset on Sunday.Dan Balilty for The New York TimesIt was Mr. Lapid who brought the coalition together, working with an array of vastly differing parties, and promising to make way for Mr. Bennett even though his own party had won more seats.The coalition will face threats to its cohesion as soon as Monday, when it must decide whether to allow a far-right march through Palestinian areas of East Jerusalem. The march is a rescheduled version of an aborted event that was cited by Hamas as one of several reasons for firing rockets last month toward Jerusalem, setting off the recent conflict in Gaza.“The coalition is such an ideological patchwork it might even be a jigsaw puzzle,” said Dahlia Scheindlin, a Tel Aviv-based political analyst. “And it’s not clear whether the pieces actually fit together.”Patrick Kingsley reported from Jerusalem and Richard Pérez-Peña from New York. Reporting was contributed by Irit Pazner Garshowitz, Myra Noveck, Adam Rasgon and Isabel Kershner from Jerusalem, and Gabby Sobelman from Rehovot, Israel. More