The Pakistani Taliban have abandoned their last key stronghold and booby traps and explosives littering their hideouts now present the main danger to the soldiers who control the territory, military officials say.
Instead of black-clad militants, uniformed men and the odd lone donkey wander the streets of Miranshah, the capital of Pakistan's northwestern region of North Waziristan.
For years, Pakistan's allies urged the South Asian nation to strike against militant strongholds on the Afghan border. Now, as NATO troops withdraw from neighboring Afghanistan, the army launched a campaign last month to push out the militants.
A rare visit this week to Miranshah, organized by the military, showed how tightly the Taliban had held the frontier town in its grip.
“It is a city waiting to blow up, that's how much explosive there is here, in homes, in shops, buried under the ground,” said senior commander Brigadier Tahir Malik, standing outside one of 11 bomb making plants the army says it has seized.
The explosives factory is piled high with hundreds of metal cylinders and other containers the militants used to make bombs.
Ghost town
Apart from soldiers, the city is a ghost town. The army ordered residents out before the offensive; some left food on their tables as they fled.
Entire neighborhoods are rubble after caches of explosives detonated and jets pounded suspected militant hideouts.
Under the destruction lies a sophisticated network of tunnels used to smuggle militants and weapons out of the view of hovering drones.
At the Gulpakhel mosque, subterranean corridors snaked past rooms dotted with prayer mats and blankets before ending at a secret door hidden by a bookshelf. Behind lay rooms that had housed senior Taliban commanders, the military said.
Sleeping mats were scattered before freshly painted walls fitted with an air-conditioner and a sound system and lit by a six-bulb chandelier.
“Even I don't get to live like this here, with all these comforts,” said a colonel accompanying the visitors.
Cannibal market
In an area nicknamed Cannibal Market, a purple sheet shrouding a small wooden platform was the site of the Taliban's public beheadings, the military said.
The militants used to leave bodies to rot on the road, as a grim warning of the movement's justice. Former residents of the town confirmed the account.
Before the offensive, the Pakistan army confined itself to its sprawling headquarters in Miranshah, only making weekly supply runs.
But after almost a month of air strikes by fighter jets and a ground offensive using tanks and heavily armed soldiers to search from house to house, the military says it controls 80 percent of the town.
So far, the military says it has killed 400 militants, but has not followed its usual custom of releasing names or displaying bodies.
“This is not a swordfight, where one cuts off the head and presents it as evidence,” said General Zafarullah Khan, commander of the operation.
With the region sealed off by the military, there is no way to verify the casualty figures.
The army won't say when it might wrap up the operation, and let residents return home.
But the generals are confident they will succeed.
“The challenges we are facing in these areas are huge and we are deliberately being very slow,” General Asim Bajwa, the head of the military's media wing, told Reuters.
“Our goal is to establish the writ of the state and to never let these terrorists ever come back here again.”