ISLAMABAD, Pakistan — At least 11 soldiers, including an army captain, were killed and 13 others were injured Saturday when a suicide bomber detonated his explosives at a highly guarded army base in northern Pakistan, officials said.

The Pakistani Taliban claimed responsibility for the attack, one of the deadliest against the military in recent years. The powerful explosion, which rocked the surrounding area, occurred in the Kabal region of Swat, a picturesque valley in the northern part of the country.

This was the first major terrorist attack in Swat, once a Taliban stronghold, in the past five years, local residents said. The Pakistani military wrested the region from the Taliban in 2009 and has maintained a heavy presence.

The suicide bomber struck Saturday evening while the soldiers were playing volleyball after duty. Officials said they imposed a curfew, cordoned off most local roads and searched for accomplices in the aftermath.