Want smart analysis of the most important news in your inbox every weekday, along with other global reads, interesting ideas and opinions to know? Sign up for the Today’s WorldView newsletter.

As night fell in Israel, both the incumbent prime minister and his rival both declared victory. Exit polls placed Benjamin Netanyahu and his main opponent, Benny Gantz, in a neck-and-neck contest. Before cheering crowds at their party headquarters, they each hailed the performance of their parties — Netanyahu’s right-wing Likud and Gantz’s centrist Blue and White alliance — as historic achievements. But as the hours dragged on and partial results trickled in, it seemed likely Netanyahu would return to power.

With 97 percent of the vote counted at the time of writing, it appeared that both Likud and Blue and White had secured 35 seats each in the 120-member Israeli Knesset, or parliament. Although Gantz and Netanyahu seemed locked in a dead heat, the former army commander had a sparse path to victory, with Likud better positioned to govern in coalition with other right-wing parties that will enter the Knesset.

“In the coming days, Israeli President Reuven Rivlin will nominate the leader of the party with the majority of support to try to form a government,” my colleagues reported. “Rivlin will make this choice after consulting with parties that have won Knesset seats.”

If Netanyahu returns to power, he’ll be poised to become Israel’s longest-serving prime minister. It’s quite the feat, not least because he battled through a torrid political campaign under the looming shadow of indictment on corruption charges. Even with the final official result still pending, here are a few takeaways from a momentous vote:

This was always going to be a referendum on Netanyahu. The Israeli prime minister has been a dominating figure in the country’s political life for a quarter of a century and has ruled for 13 years. The legal investigations into his and his family’s alleged dodgy dealings have polarized Israeli society. For some voters, it’s inconsequential. For others, it was time to remove a politician who was getting far too accustomed to the trappings of power.

“Hopefully there will be a change today,” Michael Livny, a doctor voting in a town outside Jerusalem, told my colleagues. “I don’t really care who comes in his place. I just don’t want a crook as my leader anymore."

Israel’s politics lurched definitively to the right under Netanyahu’s watch, as he presided over the slow-motion collapse of the peace process with the Palestinians. But throughout the election campaign, he pointed to his unmatched chops as a global statesman.

Over the past decade, Netanyahu has loudly sounded the alarm, warning of Iranian aggression. His activism on this front saw him spar with the Obama administration, but it won the enduring affection of President Trump. Quietly, Israel has built up contacts with a host of Arab monarchies, which share Netanyahu’s enmity with Iran. And the Israeli leader has courted other leaders: In the run-up to Tuesday’s vote, Netanyahu received the thinly veiled endorsement of Brazilian President Jair Bolsonaro. Last week, he went to Moscow for a ceremony where the Russians handed over the remains recovered in Syria of an Israeli soldier who had been missing for 37 years; the move was seen as a pre-election boost deliberately laid out by Russian President Vladimir Putin.

Trump helped, too. No single outside actor seemed to put their thumb on the scales of the Israeli election as much as the American president. For the past two years, he vociferously backed Netanyahu on social media and doled out political gifts to the prime minister, from his decision to formally recognize Jerusalem as Israel’s capital to his recent recognition of Israeli sovereignty of the disputed Golan Heights.

Netanyahu pinned all these concessions to his mast. “He has convinced people that he is irreplaceable and that no one else comes even near to him,” Gideon Rahat, a senior fellow at the Israel Democracy Institute, said to The Washington Post. “That is the secret to his power.”

Netanyahu’s demagoguery did the trick once more. When he wasn’t declaiming conspiracies against him and bashing the media on the campaign trail, Netanyahu was stirring fears about Arabs gaining power should his political rivals win. Four years ago, he warned that Arabs were “voting in droves,” a rallying cry that arguably delivered a late surge in his favor. This year, he made somewhat more circumspect appeals, though media reports alleged that hundreds of Likud volunteers had gone to polling stations in Arab-majority areas in northern Israel armed with hidden cameras. Police were investigating “irregularities."

Arab Israeli disillusionment and marginalization affected the vote. “Israeli Arabs make up around 20 percent of the Israeli population and turned out in record numbers in 2015. But this year voters have expressed frustration about a split in the main Arab slate,” my colleagues wrote, reporting that turnout this year may have dipped by 12 percent.

Gantz’s tough record at the helm of the Israeli military won him little affection among Arab voters. That, combined with the perception that Netanyahu’s government was anti-Arab — not least for its adoption of the controversial Nation State law, which critics said downgraded the status of Arab identity in the Jewish state — also bolstered calls for a boycott.

The non-factor of the Israeli left. To no great surprise, Israel’s left-leaning parties struggled. The biggest disappointment came for the Labour Party, which seems to have won only a dispiriting 5 percent of the vote — a dramatic dip from four years ago and yet another drumbeat in the steady death march of traditional center-left parties across the Western world. It’s a bleak moment for a party that played an instrumental role in the founding of the Israeli republic and held sway for the first few decades of Israel’s existence.

The right ate its own, too. Netanyahu’s pandering to hard-line voters also sapped support from smaller parties further to Likud’s right. The biggest losers in this appear to be Naftali Bennett and Ayelet Shaked, two ministers in Netanyahu’s cabinet who harbor aspirations of eventually unseating him. Their breakaway faction — New Right — may not win enough votes to enter parliament.

Millions living under Israeli rule had no say in its election. And, of course, there’s the small matter of the close to 5 million Palestinians living under Israeli occupation who had no say in the election. Their political aspirations rarely feature in the Israeli conversation and won’t in the months to come. Indeed, polls show that a majority of Israelis are either content with the status quo or favor annexation of Palestinian lands without enfranchising Palestinians.

“Nearly 5 million of the 13 million people living in Israeli controlled territory can not vote today for the government that ultimately rules them,” tweeted Yousef Munayyer, executive director of the U.S. Campaign for Palestinian Rights. “On an American scale that’s akin to 120 million people disenfranchised. That isn’t democracy and pretending it is helps it persist.”

Want smart analysis of the most important news in your inbox every weekday, along with other global reads, interesting ideas and opinions to know? Sign up for the Today’s WorldView newsletter.