Pakistani troops battled pro-Taleban militants near the Afghan border for a second day on Sunday in clashes which have killed more than 50 people.
Tens of thousands of soldiers face tribal militants in the mountains
Pakistani officials said 46 militants and five soldiers died, although some reports put the death toll at over 70.
Clashes are over and the security forces are back in control of the town of Mir Ali, an army spokesman said.
Correspondents says it is the fiercest fighting since the army went into the area in 2003 to drive militants out.
Plumes of smoke
The violence began on Saturday morning when a group of more than 100 tribal militants attacked a military post in Mir Ali.
Security forces fought back, killing more than 20 militants.
Soon the clashes spread to Miran Shah, where several hundred militants tried to storm the main headquarters of the paramilitary troops.
The army sent helicopter gunships after tribesmen traded mortar and gunfire with security forces.
Clashes reportedly petered out in the early hours of Sunday but later on helicopter gunships pounded mountains to the east of Miran Shah, sending plumes of smoke into the sky, Reuters said.
"Now the writ of the local administration is restored and the said area is under complete command of the security forces" said army spokesman Major General Shaukat Sultan, speaking of the situation in Mir Ali.
He said some residents had been moved to "safer areas" because of the fighting.
"'We cannot rule out the killing of civilian people because militants have their hideouts in populated areas" he said, although "our operation is very targeted and precise, using radars and latest weapons and equipments".
Taleban and al-Qaeda fighters fled into North Waziristan after the US-led invasion of Afghanistan in 2001.
Tens of thousands of Pakistani soldiers are deployed there.
North Waziristan has lately turned into the main hub of pro-Taleban activities. After reports of the presence of a large number of foreign militants, security forces decided to launch an operation to flush them out, BBC correspondent Zaffar Abbas says.
Reports from the area say hundreds of families have started to flee the escalating fighting.
The violence came as US President George W Bush made a day-long visit on Saturday to Islamabad, about 300km (190 miles) to the north-east.
He declared solidarity with Pakistan in the fight against militants, and called for more work in the war on terror.