At least 20,000 people have fled fierce fighting between troops and militants in the Pakistani tribal region of Mohmand, officials and witnesses say.
Many of the displaced are sheltering in temporary camps, the authorities add.
Troops have been using helicopter gunships and heavy weapons to pound suspected militant positions for a week, according to residents.
Mohmand, on the border with Afghanistan, has long served as a sanctuary for the Taliban and al-Qaeda.
"We are targeting militant hideouts there," military spokesman Maj-Gen Athar Abbas confirmed.
The army told the BBC that 60 to 70 militants had been killed in what it calls a search and clearance operation.
There is no independent confirmation of the casualty figures - independent media have no access to the area.
Moved 'for safety'
A local administration official, Roshan Khan Mehsud, told the BBC that civilians had been displaced from Safi, Pindiali and Baizai districts, close to the border with Afghanistan.
"Most people left the area due to fear of mines and other hazards, and we ourselves moved some of them for reasons of safety," he said.
The army had also sustained "some casualties", Mr Mehsud told the Associated Press news agency. There was no immediate word on this from the military.
Officials estimate the total number of displaced people at between 20,000 to 25,000.
Nearly 2,000 families were being housed in a camp in the Nahaqai area, 40km (25 miles) south-east of Ghalanai, Mr Mehsud told the BBC.
About 750 families had gone to another camp at Danishkool, 25km north of Ghalanai.
"Over the last few days about 22,000 people have been registered in the two camps that UNHCR has helped to set up," UN Refugee Agency spokeswoman Ariane Rummery told the AFP news agency.
The BBC's Orla Guerin in Islamabad says fleeing families have also sought shelter in schools and government buildings.
Rise in attacks
Mohmand has long served as a sanctuary for militants operating against US-led troops across the border in Afghanistan's north-eastern province of Kunar.
It is also a haven for militants displaced by Pakistani troop offensives in other parts of the north-west.
While most tribal areas in Pakistan have remained relatively quiet over the past few months, militant activity in Mohmand has been on the rise.
In recent weeks, militants have bombed more than a dozen schools and attacked checkpoints. On Wednesday, at least three soldiers were killed when militants attacked a checkpoint in the Baizai area.
Pakistan supported the Taliban when they ruled in Afghanistan from 1996-2001, but later became an ally of the US when it led an invasion in 2001.
Islamabad denies it is not doing enough to fight the militants, saying it has lost more than 2,400 troops in the war since 2002.