A month of Israeli military successes , capped by the killing of Hamas leader Yahya Sinwar , is boosting Prime Minister Benjamin Netanyahu ’s popularity and strengthening his political hand.

Netanyahu, who turned 75 on Monday, has once again shown incredible staying power as a politician, after his popularity suffered in the wake of last year’s Oct. 7 attacks. More Israeli voters would choose Netanyahu to be prime minister over the main leaders of the centrist opposition, according to the results of recent polls, which were conducted before Sinwar’s killing .

His rising support among right-wing voters could improve his position as the U.S. makes a diplomatic push for a cease-fire deal and Israel weighs a response to Iran’s missile strikes on the country earlier this month.

After the Oct. 7 Hamas-led attacks on Israel, the “assumption in the political system and in his own party was that he is finished,” said Yaakov Katz, senior fellow at the Jewish People Policy Institute, a think tank in Jerusalem. “The fact that he has gone from overseeing Israel’s biggest security failure to being the preferred leader is a remarkable testament to his political survival skills.”

The rising poll numbers don’t mean Netanyahu’s political troubles are over. Far from it. Deep divisions in Israel, including over how to win the release of hostages still held in Gaza , would likely make it difficult for him to forge a governing coalition if there were to be new elections, polls show.

New elections aren’t due for another two years unless the government falls earlier and no alternative majority can be found.

Days after Sinwar’s killing, protesters were back on the streets of Tel Aviv, urging Israel’s government to give priority to a deal in Gaza to bring home the roughly 100 hostages who remain there, many of whom are now presumed to be dead.

Netanyahu has shown no new inclination to negotiate a cease-fire following Sinwar’s demise. On Thursday, he vowed to continue the war, quoting the biblical King David: “I will pursue my enemies and destroy them. And I will not turn back until they are wiped out.”

For months after Oct. 7, most Israelis wanted Netanyahu to resign. Likud lawmakers discussed ousting him, but no strong challenger emerged. Even many longtime supporters were unhappy with Netanyahu’s handling of the war in Gaza , which dragged on with no sign of the “total victory” over Hamas that the premier kept promising.

His fortunes began to turn in May, when Israeli forces moved on the city of Rafah in southern Gaza. The decision—made in the teeth of U.S. doubts about the humanitarian impact—pleased right-wing supporters who were frustrated by the government’s perceived indecision.

Netanyahu then fended off pressure from the U.S., Israel’s own military leadership and the families of hostages for a cease-fire agreement. In avoiding a deal, he was helped by the equally hard-line negotiating stance of Sinwar, say people involved in the long months of talks.

“What Netanyahu has done very smartly is not letting the war end,” said Katz. “While the war is continuing, it makes a lot of people think this isn’t the time for a change. And when something goes right, he takes credit for it, even if it didn’t have much to do with him.”

Netanyahu, whom colleagues and rivals alike describe as a master of creating political narratives, managed to rally his base by portraying the U.S. as well as Israel’s security establishment as impediments to victory, for their advocacy of a hostage deal with Hamas.

But it was those security agencies, which delivered a series of devastating blows against Hezbollah, beginning with the detonation of the militia’s pagers on Sept. 17, that have helped shift the focus away from Gaza to Israel’s northern front .

That has helped Netanyahu to win back supporters who were frustrated by the lack of decisive measures to deal with Hezbollah, which has been firing rockets at northern Israel since Oct. 8 last year.

Yet, voter support for Netanyahu’s coalition appears to have hit a ceiling. Some of Likud’s recent gains have come at the expense of its own far-right partners. Meanwhile, some right-wing voters are keeping their distance from Netanyahu.

“He still hasn’t been able to break out,” said Dahlia Scheindlin, an Israeli political consultant and opinion pollster.

In late September, Netanyahu showed his talent for co-opting and dividing his rivals, persuading a small center-right party to defect from the opposition and join his government. The extra four seats in the Knesset, Israel’s parliament, also made him less vulnerable to pressure from far-right coalition allies.

“The Israeli system makes it very difficult for any opposition to bring down the government. For that to happen, the reigning coalition has to crack from within,” said Nimrod Novik, a fellow at the Israel Policy Forum, a New York-based think tank.

The premier’s biggest asset is the lack of a convincing opposition leader, say many analysts.

“There is no real opposition offering an alternative path in the current war, even though people have doubts that Israel can achieve its goals, let alone articulate an alternative future for Israel,” said Scheindlin.

She said the centrist former general Benny Gantz , whose once-strong popularity has faded in recent months, “never developed a political personality, a vision for the country.”

The months ahead will test Netanyahu’s ability to manage Israel’s multi-front war beyond vowing to carry on fighting.

Israel’s military leaders have warned that achieving lasting security benefits will require finding political arrangements in Gaza and Lebanon that prevent the re-emergence of hostile militant armies.

“Netanyahu has yet to leverage the military achievements into a political success,” said Katz. “He is afraid to outline a political resolution in either Gaza or southern Lebanon, because whatever the answer, there will be a political price,” he said.

Write to Marcus Walker at Marcus.Walker@wsj.com