the tension between secular Israelis, who once were a majority of Jewish citizens, and religious Israelis.
Mr. Liberman found himself aligning with liberals from the left and center in calling to curtail the financial and social burdens that the very religious impose on other Israelis. They demanded more pluralistic options for marriages and conversions, now dominated by the ultra-Orthodox rabbinate. And they expressed fury at the growing influence of a group of ultrareligious nationalist Jews who espouse anti-feminist, anti-gay views and a far-right, messianic ideology.
But Mr. Netanyahu had forged an ironclad bond with the ultra-Orthodox, and for good reason: They vote en masse, and at rates that are the envy of other parties. And with secular leaders singling them out as targets, ultra-Orthodox leaders said it was easier than ever to rally their voters to the ramparts.
Even Mr. Netanyahu’s biggest comfort zones — national security and diplomacy — were a source of unexpected headwinds.
President Trump pressured him into barring two Democratic members of Congress from entering Israel, setting off a political firestorm. Then Mr. Trump broached the idea of opening talks with Iran, which Mr. Netanyahu opposed. And Mr. Netanyahu’s staunchest advocate in the White House, John Bolton, the hawkish and fiercely anti-Iran national security adviser, was forced out.
In the end, Mr. Trump’s only election-eve gift to Mr. Netanyahu was a Twitter message on Saturday in which he talked of a United States-Israel defense treaty. National-security professionals in both countries have long opposed such a pact.
Mr. Netanyahu was battling on two fronts as his political timetable converged with his legal one.
Facing possible indictment in three corruption cases on charges of bribery, fraud and breach of trust, he has a last chance to avoid prosecution in a special hearing with the attorney general set for Oct. 2. Gaining parliamentary immunity may offer his best chance of avoiding prosecution.
One of the biggest surprises of the election was the apparent strength of the Arab vote. According to the exit polls, the Arab bloc may have gained up to three new seats in Parliament.
Only 49 percent of Arab voters cast their ballots in April, as many punished Arab lawmakers for splintering into rival factions. The politicians took the hint, and reunited into a single Joint List.
Mindful that Arab citizens want to see tangible improvements in their lives and to exert influence befitting one-sixth of the voting-age population, the Joint List’s leader, Ayman Odeh, broached the possibility of entering a center-left government under Mr. Gantz.
Mr. Gantz, for his part, gave interviews to Arabic-language news organizations, and Blue and White and other Jewish parties promised to fight crime, build housing and add hospital beds in Arab areas. Turnout among Arab voters was expected to approach 60 percent.
Gabby Sobelman and Yardena Schwartz contributed reporting from Tel Aviv.
A version of this article appears in print on
of the New York edition
with the headline:
Voters in Israel Keep an Election Too Close to Call. Order Reprints | Today’s Paper | Subscribe