Islamabad, Pakistan (CNN) -- A teenage suicide bomber killed at least 27 army recruits and wounded 42 others Thursday when he blew himself up at a military training center in northwest Pakistan, officials said.
The Pakistani Taliban claimed responsibility for the blast, saying it was a "message for those who wish to join (the) pro-American military."
"We will continue targeting Pakistan military until it stops supporting the U.S.," said Azam Tariq, the central spokesman for the group.
The suicide bomber, who was about 14 years old, was wearing a school uniform, a senior Pakistani military official said.
The military official asked not to be named because he was not authorized to talk to the media.
The teenager detonated his explosives after walking onto the grounds where army recruits were receiving their morning training, according to police chief Abdullah Khan.
The bomber was either carrying the explosives in a bag or wearing a suicide vest, officials said.
A school for children of military recruits is located inside the training facility. The attacker was probably pretending to be a student there, the military official said.
The attack took place in Mardan, a district 50 kilometers (31 miles) north of Peshawar in Pakistan's Khyber-Pakhtunkhwa province, formerly known as the North West Frontier Province.
Peshawar is the gateway to the country's tribal region where security forces have been battling an insurgency led by the Pakistani Taliban.
Journalist Nasir Habib contributed to this report.