The Pakistani army says it is preparing to flush "hardcore" Taliban rebels out of the Swat valley after regaining control of the main city, Mingora.
"We are going after the leadership and we are going to take care of all the militants in the valley," spokesman Maj Gen Athar Abbas told the BBC.
Clashes continued outside Mingora but its centre was under control, he said.
Essential services were being restored to the city, he added, which was home to 300,000 people before the fighting.
Doctors had arrived to re-open the main hospital, gas had been restored and mobile generators would help restore the water system, the general said.
But he suggested it would take at least two weeks to restore the electricity network. Local defence committees would be set up eventually to stop militants returning, he added.
With journalists barred from the area, it is impossible to verify the situation in the city independently.
Some 2.5 million people have fled their homes since military operations began in Swat more than a month ago.
"We have been able to block the major routes and the entries, exit points of the valley," said Gen Abbas.
"So we are in a better position to flush out, to eliminate the main militants, the hardcore militants of the valley."
Troops now have Charbagh, a Taliban stronghold 32km (20 miles) north of the valley, in their sights, the BBC's Humphrey Hawksley reports.