Taliban fighters had dug themselves into bunkers built into hotels and government buildings in Mingora, and initially offered stiff resistance as troops first closed roads leading to the town then began moving in earlier this week, army spokesman Maj. Gen. Athar Abbas said.
Aid was being distributed to some of the estimated 20,000 who were trapped in Mingora, and water and gas supplies were being restored. But Abbas said it would be at least two weeks before power is switched back on, and refugees were not yet being encouraged to start returning to their homes.
About 3 million people have fled the fighting in Swat, and the exodus has raised fears of a humanitarian crisis.
Abbas said an unknown number of militant fighters were able to escape Mingora despite the military having it surrounded, raising the prospect that they could return to the fight elsewhere.
Never miss a local story.
The military launched a major offensive about one month ago in the Swat Valley and neighboring areas to oust Taliban militants who had been extending their control over the northwestern region near the border with Afghanistan.
U.S. and other officials say the lawless border region is being used by al-Qaida and the Taliban as a base to plan and launch attacks on Western forces in Afghanistan. The officials see the offensive as a test of Pakistan's resolve to fight extremism on its soil.
Government troops had been advancing steadily into the Swat region for about a month, bombarding towns from the air and fighting house-to-house with Taliban gunmen in some places.
“When they realized that if they did not leave these areas the noose would tighten around them and they would not find a way to leave … they decided to end the fight and leave,” Abbas said.
Information Minister Qamar Zaman Kaira said the number of people uprooted by the fighting had reached “around 3 million,” and that more than 190,000 of them were living in refugee camps. The rest are staying with relatives or relying on goodwill from local residents.
The widespread domestic support for the campaign could sour if the government is perceived to have failed the refugees, or if a high number of civilian casualties is revealed.
Abbas said an emergency medical team had been flown to Mingora and would work to reopen the town's hospital and treat civilians wounded in the fighting.