He attacked as recruits conducted morning exercises inside an enclosed military area of the city of Mardan.
Correspondents say there has been a relative lull in the number of attacks on the army in the region, where Taliban militants are active.
A Taliban spokesman said the militants had carried out the bombing.
AnalysisThe Mardan bombing points to the continuing ability of militants in the north-west to strike at high security locations. The use of a bomber in his late teens is not unusual. But the fact that he wore the uniform of a college located inside the cantonment, the city's enclosed military area, helped him slip past at least six security checkpoints before hitting his target.
The Taliban have been trying to launch an attack within the Mardan cantonment since 2008. In May that year, a suicide bomber blew himself up near a bakery in the cantonment after he failed to get through a police checkpoint.
In July 2010, a group of militants scaled the rear walls of the cantonment to launch a gun and bomb attack, but were beaten back by the police and troops.
The latest attack comes after a long lull, and days after the army launched an operation in the nearby Mohmand tribal region.
Mardan police official Abdullah Khan told the BBC that the teenage bomber had been wearing the uniform of a school located in the area, Aziz Bhatti CollegRead More