With indictments against him looming in three corruption cases, the election’s less-than-vindicating apparent outcome would put his future in grave jeopardy. As prime minister, he could stay in his post even if indicted, under Israeli law. And he could press his coalition to grant him immunity from prosecution. But as a lesser minister or ordinary lawmaker, he would have to resign if charged.

Israeli exit polls have often proven unreliable, and the official results, trickling in overnight and through the following day, did little to clarify the picture sharply. Many Israelis recalled the election of 1996, when they went to bed with the Labor leader Shimon Peres as the winner and woke up in the morning with Mr. Netanyahu as their next prime minister.

The two main contenders had offered Israelis starkly different choices.

Mr. Netanyahu was aiming for a narrow coalition with right-wing and ultra-Orthodox parties, who had promised to grant him immunity as he vowed to annex a large swath of the occupied West Bank. His heavy reliance on the ultra-Orthodox parties would only perpetuate and even expand what many see as their disproportionate influence over matters of religion and state.

Mr. Gantz pledged to forge a broad, secular government aimed at curbing the influence of the ultra-Orthodox, protecting the institutions of democracy and rule of law, and healing internal divisions. He pledged to govern “from the center out,” saying 80 percent of Israelis agreed on 80 percent of the issues.

But in the hours after polls closed and through Wednesday, Israel was effectively on hold, suspended between those two visions and unclear about its path forward.

Just five months after the last inconclusive ballot, the country could once again face weeks of feverish coalition negotiations, political paralysis, brinkmanship and instability. A new government could take until November to be formed, marking a full year in campaign mode, a first for Israeli politics.