The Pakistani military says the main aim of a militant attack on army headquarters was to take top officers hostage and use them to negotiate the release of jailed comrades.

Military spokesman Maj. Gen. Athar Abbas told reporters Monday that the militants who launched the weekend attack came from the area of South Waziristan. The army is planning an offensive against the Taliban in that area, which is along the Afghan border.

The 22-hour raid on the army compound killed 23 people, including nine militants and 14 others.

SLIDESHOW: Pakistan Attacks