By JANE PERLEZ and PIR ZUBAIR SHAH
MARDAN, Pakistan — For the past month and a half, the Pakistani military has claimed success in retaking the Swat Valley from the Taliban, clawing back its own territory from insurgents who only a short time ago were extending their reach toward the heartland of the country.

Yet from a helicopter flying low over the valley last week, the low-rise buildings of Mingora, the largest city in Swat, now deserted and under a 24-hour curfew, appeared unscathed. In the surrounding countryside, farmers had harvested wheat and red onions on their unscarred land.

All that is testament to the fact that the Taliban mostly melted away without a major fight, possibly to return when the military withdraws or to fight elsewhere, military analysts say. About two million people have been displaced in Swat and the surrounding area as the military has carried out its campaign.

The reassertion of control over Swat has at least temporarily denied the militants a haven they coveted inside Pakistan proper. The offensive has also won strong support from the United States, which has urged Pakistan to engage the militants.

But the Taliban’s decision to scatter leaves the future of Swat, and Pakistan’s overall stability, under continued threat, military analysts and some politicians say.

The tentative results in Swat also do not bode well for the military’s new push in the far more treacherous terrain of South Waziristan, another insurgent stronghold, where officials have vowed to take on the leader of the Pakistani Taliban, Baitullah Mehsud, who remains Pakistan’s most wanted man.

Signs abound that the military’s campaign in Swat is less than decisive. The military extended its deadline for ending the campaign. Even in the areas where progress has been made, the military controls little more than urban centers and roads, say those who have fled the areas. The military has also failed to kill or capture even one top Taliban commander.

It was “very disappointing,” said Aftab Ahmed Sherpao, a senior politician from the region, that none of the commanders had been eliminated. It turned out, he said, that early reports of the capture of Ibn Amin, a particularly brutal commander from Matta, were incorrect.

Many Taliban fighters have infiltrated the camps set up for those displaced by the fighting and are likely to return with them to Swat, said Himayatullah Mayar, the mayor of Mardan, the city where many of the refugees are staying. “Most of the Taliban shaved their beards, and they are living here with their families,” he said.

As of two weeks ago, the police had arrested 150 people in the camps suspected of being members of the Taliban, Mr. Mayar said. This figure did not include suspects arrested by the Intelligence Bureau, Pakistan’s domestic intelligence outfit, and the Directorate for Inter-Services Intelligence, the country’s main spy agency, he said.

Meanwhile, the government, led by President Asif Ali Zardari, has yet to announce a full plan for how it will provide services like courts, policing and health care that will allow the refugees to return home and the government to fully assert control.

Those plans appear to be mired in conflict and mutual suspicion between the military and the civilian government, raising serious questions about whether the authorities can secure Swat and other areas and keep them from being taken back by the Taliban, military experts said.

“I’ve told the president and the prime minister and the chief of the army this is the time to act. Just take basic things and implement them,” said Gen. Nadeem Ahmad, the commander of the Special Support Group, an arm of the Pakistani military that is providing temporary buildings and some food for the displaced. “This is not talking rocket science.”

On a notepad, General Ahmad had drawn a chart of the four elements of what he called “lasting peace.” They were good government; improved delivery of services, including rebuilt schools; speedy justice (something the Taliban had provided); and social equity.

He appeared to be skeptical that those aspects could be delivered within what he called an essential one-year time frame. He said he had warned the leaders: “If you don’t deliver, it will be trouble. You will come back and do the operation again.”

Having witnessed past episodes of deal-making with the Taliban, the people of Swat say they want tangible proof that the military is serious this time and that they will be safe if they return home.

From the start, a rallying cry has been a demand that the army kill or capture Taliban leaders, a ruthless group of highly trained fighters, some with links to Al Qaeda. But the army has not been able to show any evidence that it killed any of the Taliban leaders.

The daily newspaper The News said in a recent editorial that unless Maulana Fazlullah, the Taliban’s main commander in Swat, and Mr. Mehsud, the country’s top enemy, were captured, “the Taliban are going to live to fight another day.”

Indeed, most of the damage from the recent fighting appears confined to small agricultural hamlets outside Mingora, according to interviews with displaced people. Some said they had heard from recent arrivals to the camps that areas 500 yards off the roads remained in control of the militants.

The “outlook was bleak” in Swat because the civilian government did not have the money or the skills to rebuild, said Shuja Nawaz, the author of a history of the Pakistani military and now the director of the South Asia Center at the Atlantic Council in Washington.

Most of the two million displaced people are still living in tent camps and cramped quarters with relatives and even strangers, in cities as far flung as the southern port of Karachi.

Many displaced people were fed up with the cruelties inflicted under Taliban rule and have backed the military campaign. But as the fighting drags on in places, the mood among them grows increasingly despondent.

Some displaced people said that they were angry at the army for indiscriminate shelling in civilian areas. Others said they were confused about why the military operation was even necessary.

“We had no problem with the Taliban,” Umar Ali, a poultry trader from Qambar in Swat, said as he sat on the veranda of a home in Swabi, a town filled with displaced people. “We’re here because of the military shelling. I’m a trader, and the thing that affects my life is the curfew.”

Earlier Pakistani campaigns against the Taliban do not offer an encouraging precedent. In Bajaur, a part of the tribal areas, two main economic centers, the market towns of Loe Sam and Inayat Kalay, remain in ruins nearly eight months after the army smashed them in pursuit of the Taliban and claimed victory.