The Blue and White leaders are drawing on their military backgrounds to counter Mr. Netanyahu’s contention that only he can protect Israel. Mr. Gantz and his colleagues have also focused on the corruption accusations against Mr. Netanyahu, his biggest vulnerability, to press their case that new leadership is needed.

They have attracted backing from smaller centrist parties. And what remains of the left-leaning opposition has thrown its support behind Mr. Gantz for prime minister. The Labor Party would be likely to recommend Mr. Gantz for the premiership after the election.

What makes this election different?

Mr. Netanyahu could be indicted. Israel’s attorney general announced last month that he planned to bring charges of bribery, fraud and breach of trust.

A final decision on charges is likely by year’s end. Under the current law, Mr. Netanyahu, if re-elected, would not have to resign until a final conviction, although new legislation or public pressure could force him to step down. Mr. Netanyahu has described the charges as a baseless partisan witch hunt. But with a first sitting prime minister to be charged, Israel would be entering uncharted legal and political terrain.

The uncertainty has worked against Mr. Netanyahu in the prelude to the vote.

“The attorney general’s report has done something that has never happened in Israel’s 70-year history, and that is that a prime minister is under a legal cloud,” said David Makovsky, an expert at the Washington Institute for Near East Policy.

The election also is the first time that three former heads of the army, the Israel Defense Forces, have united to run for office. The Blue and White alliance is led by Mr. Gantz and two other veteran generals, Gabi Ashkenazi and Moshe Yaalon.

They have teamed up with a well-known centrist party, Yesh Atid, led by Yair Lapid, a former journalist, television host and finance minister. Mr. Gantz has agreed to hand off the prime minister position to Mr. Lapid after two and a half years if their parties win.