At least 80 militants have been killed in an air strike by Pakistani forces on a madrassa (religious school) used as a militant training camp, the army says.
The army said the madrassa in the tribal area of Bajaur bordering Afghanistan was destroyed by helicopter gunships early on Monday.
One eyewitness told the BBC that 70-80 students were inside. A leading local politician says the dead were innocent.
Pakistan has deployed nearly 80,000 troops along the border.
They are there to hunt militants who sought refuge in the rugged tribal terrain after the ousting of the Taleban in Afghanistan in late 2001.
President Pervez Musharraf has pledged to reform madrassas after many were criticised for supporting Islamic militancy.
Monday's attack took place near Khar, the main town in Bajaur.
The leader of the madrassa, radical cleric Maulana Liaqat, was among the dead.
He was a prominent member of a group of pro-Taleban tribal clerics, the BBC's Rahimullah Yusufzai in Peshawar says.
"We received confirmed intelligence reports that 70-80 militants were hiding in a madrassa used as a terrorist training facility, which was destroyed by an army strike, led by helicopters," army spokesman Maj Gen Shaukat Sultan told the Associated Press news agency.
However, an eyewitness told the BBC that the madrassa school was filled with about 80 local students who had resumed studies after the Muslim Eid holidays.
At least three helicopters were reportedly involved in the attack
People at the scene told reporters that body parts were scattered in the area after the attack.
"We heard helicopters flying in and then heard bombs," villager Haji Youssef said.
"We are all saddened by what we have seen."
A cabinet minister from Pakistan's North West Frontier Province, Siraj ul-Haq, said he would resign in protest over the attack.
"This is a very wrong action. They [the victims] were not given any warning. This was an unprovoked attack on a madrassa. They were innocent people," Siraj ul-Haq told the Associated Press.
Journalists trying to get to the scene were being turned back as they tried to enter the Bajaur region.
The attack came two days after local militants attended a rally in the area where they declared the al-Qaeda leader Osama Bin Laden and Taleban chief Mullah Muhammad Omar as their heroes.
The BBC's Barbara Plett in Islamabad says Monday morning's attack coincides with peace talks between tribal elders and pro-Taleban militants in Bajaur.
Politician Siraj ul-Haq visited the scene of the attack
The government had already released prisoners in anticipation of a deal, possibly along the lines of an agreement signed in the neighbouring tribal region of North Waziristan, our correspondent says.
But the army says peace talks would not be allowed to serve as a cover for militant activity.
Bajaur, which borders Afghanistan's insurgency-plagued eastern province of Kunar, was the scene of a controversial US air strike in January, believed to be aimed at al-Qaeda number two Ayman al-Zawahiri.
The 13 January raid killed at least 18 people, mostly civilians.
In May, Pakistani authorities said a senior al-Qaeda figure, Abu Marwan al-Suri, had been killed in Bajaur during a clash with local police.