A teenage suicide bomber killed up to 27 Pakistani army recruits at a parade ground on Thursday, an attack the Taliban said was vengeance for US drone strikes and local military offensives.
Wearing school uniform, the boy blew himself up at the parade inside a heavily guarded military compound in the town of Mardan, killing the soldiers with shrapnel and explosives, officials said.
It was the deadliest suicide bombing in Pakistan since a woman with a bomb strapped under her burqa killed 43 people at a UN food distribution point on Christmas Day 2010 in the tribal district of Bajaur.
The Taliban claimed responsibility and threatened "bigger attacks" in coming days to avenge American drone strikes and Pakistani military operations targeting Islamist militants in the northwestern tribal belt.
"It was a suicide attack. The teenager bomber was on foot and was wearing a school uniform," Abdullah Khan, a senior police officer in Mardan, around 30 kilometers (20 miles) from the regional capital Peshawar, told AFP.
Afterwards, soldiers in bullet-proof jackets and helmets cordoned off the area 400 meters (1,300 feet) from the Punjab Regiment Centre, standing alert on jeeps mounted with machine guns and preventing access to the site, said an AFP reporter.
The information minister in the northwestern province Khyber Pakhtunkhwa said 27 soldiers were killed and 35 wounded.
"Militants want to pressurize us with such attacks," Mian Iftikhar Hussain told the provincial assembly in Peshawar.
Police confirmed the toll, but the army stood by a toll of 20 recruits.
Pakistan suffers near-daily attacks blamed on Taliban and Al-Qaeda-linked militants -- the attacks have killed more than 4,000 people since government troops evicted Islamists from an Islamabad mosque in a deadly July 2007 siege.
Most of the violence is concentrated in the northwest, where Washington has branded the lawless tribal belt snaking the border with Afghanistan as the global headquarters of Al-Qaeda and the most dangerous place on Earth.
Pakistan is under pressure to eliminate militant sanctuaries to help US efforts to win the war against the Taliban in Afghanistan and defeat Al-Qaeda.
But attacks on police and soldiers have spiked since the start of a fresh offensive in the tribal district of Mohmand, where the United Nations has said around 25,000 people have fled the fighting.
Mardan is around 50 kilometers east of Mohmand.
"We proudly claim this suicide attack," Taliban spokesman Azam Tariq told AFP by telephone from an undisclosed location.
"We will continue such attacks on those people who are providing security to the Americans. These attacks are to avenge the drone attacks and military operations in the tribal areas."
Relations between Pakistan and the United States have sunk to a new low since a US official shot dead two men in the eastern city of Lahore last month, and was taken into Pakistani custody under investigation for double murder.
Raymond Davis said he acted in self-defense, fearing the men were about to rob him. Washington says he has diplomatic immunity and should be released immediately.
Pakistan Interior Minister Rehman Malik has confirmed the American had a diplomatic passport, but the government says the matter stands with the courts, where lawyers argue that diplomatic immunity be waived in case of grave crimes.
The military announced separately Thursday it had successfully test fired a cruise missile capable of carrying nuclear and conventional warheads.
The Hatf 7 (Babur) had a range of 600 kilometres (375 miles), and could carry conventional and other warheads, it said.
Pakistan and its chief rival India, which have fought three wars, two of them over the disputed territory of Kashmir, have routinely carried out missile tests since both demonstrated nuclear weapons capability in 1998.