BBC News, Bajaur
Entering the combat zone, we drive past mile after mile of flattened buildings, crops and trees, razed to prevent ambushes.
Even still, soldiers are on high alert, watchful for possible attacks.
They race down the road at top speed, firing occasional rounds from the guns mounted on the backs of their vehicles. Cobra attack helicopters circle overhead.
This is the tribal area of Bajaur near the Afghan border, or rather a small part of it.
The Pakistan army has wrested control of a 38km (24-mile) region from the Taleban, and it has given us rare access to the frontline.
We arrive in the town of Loi Sam, now in ruins. Militants here were targeted by the air force and artillery, followed by a ground offensive that lasted five days.
Civilians fled long ago - hundreds of thousands have been displaced by the fighting.
A tank guards one of the approaches to the town, firing whenever there is movement in the distance.
Already a bulldozer has begun clearing away the blasted shells of buildings.
"You have to either occupy or remove the structures," says one soldier, "otherwise the militants will return to them once we've left."
Barbara Plett reports on fighting between Pakistani troops and Taleban-linked militants
For the army, this is a crucial victory: Loi Sam lies at a key crossroads between Afghanistan and Pakistan. From here local and Afghan insurgents could launch attacks in both countries.
"The militant activities from this tribal agency were radiating in different directions, towards Afghanistan, the rest of the border region and [Pakistan's] settled areas," says army spokesman Maj Gen Athar Abbas.
"Now we have this area under control, it will affect militant activities elsewhere, and we'll capitalise on that."
"The worst is over," agrees Maj Gen Tariq Khan, who is in charge of the offensive. "I think we have turned the corner."
The battle has been slow and deliberate. It took six weeks for the army to secure the road from the headquarters of the local security forces, the paramilitary Frontier Corps (FC), to Loi Sam, a distance of 13km.
Troops fought compound to compound in a terrain ideal for guerrilla warfare
Pakistan's PM calls for more US cooperation "There are road bends, there are depressions, there are houses located inside the depressions, trenches prepared, caves, tunnels, everything prepared," says Col Javed Baloch, commander of one of the posts along the road, "so it was difficult to find them, to spot them, and then take the area."
The Taleban has made extensive use of bunkers and tunnels which connected different compounds.
One commanding officer, Maj Kamal, took me 5m underground for a tour of the network.
He says his men blocked 20 or 30 passageways, including one that stretched 100m to a stream.
Many in Bajaur trace the roots of the uprising to a suspected US missile strike on an Islamic seminary, or madrassa, in November 2006, which killed around 80 people.
That radicalised local Islamists, they say, who were reinforced by militants from other Pakistani tribal areas. There was also an influx of fighters from Afghanistan.
The battle for Bajaur was triggered when the FC tried to re-establish a check post in Loi Sam in early August. Fierce resistance led to the siege of the FC base before the army was called in.
Like other army officers, Maj Gen Tariq Khan criticises unilateral US air strikes on suspected insurgent targets as deeply counter productive.
But, he says, during the Bajaur operation there has been improved intelligence sharing and co-ordination with coalition forces, which has reduced cross-border militant infiltration from Afghanistan. "We've seen practical on-ground adjustments in relevance to our operations," he says.
"I've got a very positive response and I feel we've set up some system in which we're in some kind of regular touch, and I think that's the way to go."
Hearts and minds
Now that the fighting has subsided, attention is turning to reconstruction and development: acknowledgement that winning hearts and minds in the impoverished tribal region along the border is essential to fighting the insurgency.
But that won't be enough, says Shafir Ullah, the government representative in Bajaur who deals with tribal elders.
"The reasons [for the insurgency] are poverty, backwardness and others, but the real problem is linked with Afghanistan," he says.
"Until and unless Afghanistan is made stable, you can do a million development activities in the Federally Administered Tribal Areas, and there will be no result."
The Taleban have been pushed back - the army claims it has killed 1,500 - but they haven't been defeated.
Two soldiers were killed by rocket fire in Loi Sam shortly after we left the town, bringing the army's death toll to 75. Nearly 100 civilians have also died, says Shafir Ullah.
One hillside post is so exposed to Taleban fire that the soldiers have dug in for protection.
Forty men can fit in the massive bunker at any one time, a few are saying their prayers and reciting the Koran in a makeshift underground mosque when we visit.
This is not a popular war in Pakistan: some have criticised the military for killing fellow Muslims.
Others accuse it of fighting "America's War". But the army insists it is fighting to defend Pakistan, not just responding to US pressure for action against the Taleban.
Even as dusk falls artillery guns continue to pound militant positions. The war in Afghanistan has spilled over into Pakistan.
This is the other, rarely seen, side of the battle against the Taleban
7 months ago