A suicide bomber killed at least 11 soldiers and injured 13 at an army camp in northwestern Pakistan on Saturday, the military said.
An officer was among those who died in the bombing, which was claimed by the Pakistani Taliban in an email to journalists.
The attacker targeted an army unit's sports area in the Kabal area of the Swat Valley, the military's media wing said in a statement.
Violence in Pakistan has declined in recent years following a series of military offensives along the northwestern border with Afghanistan, but militant groups are still able to carry out bloody attacks.
There have been a number of deadly assaults in recent months in the northwest as well as in the southwestern Balochistan province.
The Swat Valley was under the de facto control of the Pakistani Taliban in 2007-2009. They imposed their harsh brand of Islamic law, and carried out public floggings and executions until a military operation drove them out.
The area has seen sporadic militant attacks since, including assassinations of local leaders who cooperate with the government.