DOHA, Qatar — Israel says it has killed thousands of Hamas’ militants, dismantled the command structure of nearly all its battalions and pummeled its tunnel network. The bombing campaign in the Gaza Strip has been so devastating that the urban landscape in the territory has become unrecognizable.

But Israel’s military has said that eliminating Hamas isn’t possible — even if Prime Minister Benjamin Netanyahu has called for “total victory” over the group.

One of Hamas’ most senior officials, Khaled Meshal, maintains that the group is even winning the war and will play a decisive role in Gaza’s future.

“Hamas has the upper hand,” Meshal said in an interview with The New York Times in Doha, Qatar, where he is based. “It has remained steadfast” and brought the Israel military into “a state of attrition,” he said.

Hamas’ reasoning is simple — winning simply means surviving and, at least for now, the group has managed to do that, even if it is severely weakened.

The comments by Meshal, 68, in the two-hour interview in the living room of his home in Doha, offered rare insights into the thinking of Hamas officials. He is one of the most senior figures in Hamas’ political office and is considered a key architect of the group’s strategy.

Meshal was the target in 1997 of a failed assassination attempt by Israel in Jordan, and he served as Hamas’ political chief for more than two decades. In early September, U.S. federal prosecutors unsealed charges against him and other Hamas leaders, accusing them of playing a central role in planning and carrying out the Oct. 7 attacks on Israel.

In the interview, Meshal made clear that Hamas officials are not in a rush to conclude a cease-fire with Israel at any price, and will not give up on their main demands for an end to the war and an Israeli withdrawal.

Independent analysts have made similar assessments about Hamas’ priorities. “They completely feel time is on their side,” said Ghaith al-Omari, an expert on Palestinian affairs. “They think they’re the only game in town.”

It is a confidence continuously tested on the battlefield in Gaza. While Hamas remains a powerful force in the enclave, it has faced criticism from Palestinians in Gaza who blame the group for putting them in harm’s way. And Hamas’ definition of success may no longer be valid if the war drags on for years and Israel succeeds in taking out much of Hamas’ remaining firepower, according to Palestinian analysts.

At the war’s start, President Joe Biden expressed a similar position to that of Netanyahu — that Hamas needed to be eliminated. But Biden no longer speaks of its eradication, and both the United States and Israel have taken part in indirect negotiations with Hamas.

Meshal said he took that to mean the United States was acknowledging Hamas was not going anywhere.

“The Israeli-American vision wasn’t talking about the day after the war, but the day after Hamas,” he said, referring to the initial stance by Israel and the United States.

Now, he said, the United States is saying, “We’re waiting for Hamas’ response.”

“They’re practically recognizing Hamas,” he added, without mentioning that the group has been designated a terrorist organization by the United States and Israel.

Some current and former Israeli security officials also say they believe Hamas is unlikely to be defeated in this war.

“Hamas is winning this war,” said Maj. Gen. Gadi Shamni, a former commander of the Israeli military’s Gaza division. “Our soldiers are winning every tactical encounter with Hamas, but we’re losing the war, and in a big way.”

Thousands of Hamas fighters and government officials continue to wield control over large parts of Gaza. In cities where Israeli forces briefly took control, their eventual departure left a void that was swiftly filled by Hamas and other militant groups.

“There’s no one that can challenge Hamas there after Israeli forces leave,” Shamni said.

The greatest failure, he said, is that Netanyahu has not tried to introduce a realistic alternative governing body in Gaza in the aftermath of Israeli retreats.

The Israeli military has said it has killed more than 17,000 militants in Gaza. A military intelligence official said this summer that Israel had succeeded in undermining Hamas’ ability to fire long-range rockets at Israel, though they had other, less sophisticated munitions.

The process of taking over and demolishing tunnels, the official said, was an extremely complex engineering project that could take years.

Some members of the military leadership have concluded that a cease-fire with Hamas is the best path forward, even if it leaves the group in power for the time being.

Despite Hamas’ immense losses, including many senior commanders killed by Israel, Meshal said he was confident the group would play a dominant role in Gaza following the war. He dismissed alternative U.S. and Israeli proposals for administering the territory without Hamas.

“All their illusions about filling the vacuum are behind us,” he said.

The United States has proposed bringing a “revitalized” Palestinian Authority to Gaza; Israel’s defense minister has suggested that Arab forces provide security in the territory; and Netanyahu has considered working with “local stakeholders with managerial experience.”

“Assuming Hamas won’t be in Gaza or influencing the situation is a mistaken assumption,” Meshal said, insisting that Palestinians alone would determine arrangements for the territory.

Hamas’ confidence about maintaining a dominant role in a postwar Gaza has also been seen in private meetings with Palestinian politicians.

Many Palestinians in Gaza have lashed out at Hamas for launching the Oct. 7 attack on Israel that left 1,200 people dead, accusing the group of giving Israel a pretext to wage a massive bombing campaign that has reduced cities to rubble.

Meshal dismissed criticism of Hamas’ decision. He acknowledged that the assault had caused enormous destruction but said it was a “price” Palestinians must pay for freedom.

Asked how the Hamas-led attack had helped improve the situation given the devastation in Gaza, he insisted it was less about achieving a military victory over Israel than making it realize its policies weren’t sustainable.

“Before Oct. 7, Gaza was dying a slow death,” Meshal said. “We were in a big prison and we wanted to get rid of this situation.”