At least 30 people have been killed in a blast in a troubled tribal area of north-west Pakistan near the Afghan border, officials and locals say.
Locals told the BBC an air strike had been carried out on a religious school. At least 15 were injured in the attack in North Waziristan, they said.
The army say the dead were pro-Taleban rebels, killed when a bomb being made at their base exploded prematurely.
In the past, many such blasts have turned out to be missile strikes.
A military official, speaking on condition of anonymity, said Tuesday's blast was caused by missiles from Afghanistan.
But locals told the BBC an aircraft came, bombed the area and then went back to Afghanistan.
The apparent attack was said to have come from over the border at the village of Kalarai in the Shawal area of North Waziristan, about 40km (25 miles) west of Miranshah.
Locals said the target was a madrassa (religious school) and most of the dead were students, among them children.
Military spokesman Maj Gen Waheed Arshad said it was a training facility for militants and a bomb they were making blew up and led to the casualties.
News agencies quoted Pakistani intelligence officials saying missiles had been fired at a militant training camp - but the officials did not say by whom or from where.
Last October, an air raid on a religious school further north in Bajaur agency left more then 80 people dead.
The authorities said those killed were militants, while locals and survivors insisted they were students.
US and Pakistani military spokesmen denied reports that the missiles were fired from a US drone. The Pakistani military said they carried out the raid from their own helicopters.
A number of other raids on suspected militant targets inside Pakistani territory have apparently been launched from over the Afghan border, although never confirmed.
Pakistan has been accused of allowing the Taleban safe havens along the border, after striking a number of controversial peace deals with militants in its tribal areas.