A suicide bomber has killed at least 42 soldiers as they exercised at an army training school in north-west Pakistan.
At least 20 soldiers were injured in the attack
It is the deadliest attack by militants on the army since it began operations against pro-Taleban and al-Qaeda fighters close to the Afghan border.
There was no immediate claim of responsibility for the attack.
It happened in the town of Dargai in North West Frontier Province, not far from where the army said it killed some 80 militants last week.
The BBC's M Ilyas Khan says Wednesday's attack could undermine recent agreements between the military and pro-Taleban militants in other border areas.
Emotions in the region have been running high since an air strike on a religious school (madrassa) last week in the neighbouring area of Bajaur, in which the army said 80 militants were killed.
Local people insisted the dead were innocent religious students.
The army base targeted in Wednesday's suicide bombing is about 40km (30 miles) south-east of the bombed madrassa.
25 June 2002 - 10 soldiers killed during raid on alleged Al Qaeda hideout in South Waziristan
14 Dec 2002 - Failed attempt to assassinate President Musharraf in Rawalpindi
25 Dec 2002 - 15 killed in suicide car bomb attack on Gen Musharraf who escapes unscathed
16 March 2004 - 18 security personnel killed in ambush in South Waziristan
22 March - 19 solders killed in South Waziristan
10 June 2004 - 11 soldiers killed in attack on convoy carrying the current vice chief of army staff
30 September 2005 - 11 soldiers killed in South Waziristan
8 November 2006 - At least 42 soldiers killed by suicide attacker in North West Frontier Province
"The attack was carried out by a man who got down from a car wearing a chaddor [cloak] and walked into the parade," Interior Minister Aftab Sherpao said.
"After the Bajaur incident this was expected, but we will continue the fight against terror. We condemn it, innocent lives were lost."
The US government condemned the army camp attack and praised the efforts of the Pakistani government in tackling militants.
An eyewitness, Aurangzeb, told the BBC he saw soldiers picking up scattered body parts minutes after the explosion.
"The victims were dying. Their shoes and caps were scattered all over the place," he said.
It appeared that most of the men who died were military recruits who had been doing morning exercises.
Up to 20 soldiers were wounded in the attack. Some are believed to be in a critical condition.
The military are reported to have sealed off the area and also the hospital where the wounded are being treated.
Dargai is a stronghold of a banned pro-Taleban movement, Tehreek-e-Nifaz-e-Shariat-Mohammadi (TNSM).
The head of the madrassa targeted last week was a TNSM member. He was killed in the attack.
Survivors examine the dead after Wednesday's attack
The TNSM led thousands of tribesmen across the border into Afghanistan to take on American forces after the US-led invasion of Afghanistan in 2001. Many never returned.
In recent days, tribesmen have openly threatened suicide attacks against the army in retaliation for the madrassa air raid which many also blamed on US forces across the border.
Pakistan has deployed nearly 80,000 troops along the border to hunt militants who sought refuge after the ousting of the Taleban in Afghanistan in 2001.