RAWALPINDI, Pakistan — Commandos stormed Pakistan's army headquarters Sunday ending a day-long hostage drama and freeing 39 people held by militants who brazenly struck at the heart of the military establishment.
Three hostages, two soldiers and four suspected Taliban militants were killed in a rescue operation hailed by the military as "highly successful", despite a total of 19 people dead since the start of the assault.
Six soldiers and four other militants had already been killed in the nearly 24-hour siege, which began Saturday in the garrison city of Rawalpindi and was the third dramatic militant strike in the nuclear-armed nation in a week.
The audacious attack exposed Pakistan's vulnerability in the face of a Taliban militia who have regrouped after the death of their leader and are determined to thwart an army assault on their tribal hideouts, analysts said.
In London, US Secretary of State Hillary Clinton said the attack showed the scale of the threat faced by Pakistan but voiced confidence that the country's nuclear weapons were properly secured.
Military spokesman Major General Athar Abbas said troops went in at about 6:00 am (0000 GMT) and met resistance from five militants armed with suicide vests and barricaded in the building in the city, which adjoins Islamabad.
"Thirty-nine hostages were rescued and three were killed," Abbas told AFP, adding that the captives were shot dead by the militants.
"The militants had suicide jackets, improvised explosive devices, grenades.... They wanted to blow up all the hostages and cause maximum damage."
He said that two soldiers and four of the insurgents were killed in the rescue operation. The leader of the militant team escaped and detonated a number of explosives, before being injured and arrested.
"The operation is over. It was highly successful," Abbas added.
He said that intelligence officials were investigating possible links between the sole surviving militant -- named as Aqeel, also known as Doctor Usman -- and the March attack on the Sri Lankan cricket team in Lahore.
The Rawalpindi attack bore similarities to the March gun-and-grenade attack, which left six policemen and two civilians dead. Abbas said the militant held Sunday had the same name and alias as one of the Lahore attack suspects.
The drama began just before midday on Saturday, when nine gunmen in military uniform and armed with automatic weapons and grenades drove up to the Rawalpindi compound and shot their way through a checkpoint.
Four militants and six soldiers were killed near a second post but the rest of the rebels fled and took the 42 military employees hostage.
There has been no claim of responsibility, but military and government officials blamed Taliban-linked militants.
On her visit to London, the United States' top diplomat, Clinton, said the attack was another reminder that Islamist extremists were "increasingly threatening the authority of the state" of Pakistan.
She added, however, that the United States had "confidence in the Pakistani government and military's control over nuclear weapons".
The Tehreek-e-Taliban Pakistan (TTP) movement is based in the northwest tribal belt and is blamed for most of the attacks that have killed more than 2,200 people across Pakistan since July 2007.
The weekend siege came after a suicide car bomb on Friday killed at least 52 civilians at a busy market in the northwest city of Peshawar and an attack on a UN office in Islamabad last Monday left five aid workers dead.
The new Taliban leadership have vowed to avenge the death of their commander Baitullah Mehsud in a US drone missile attack in August, and are also keen to deter an assault on their stronghold, analysts say.
The military is wrapping up a fierce offensive against Taliban rebels in the northwestern Swat valley launched in April, with the army now poised to begin a similar assault in the nearby semi-autonomous tribal belt near Afghanistan.
Defence analyst Hasan Askari said the militant strikes showed the army had not broken the back of the Taliban, as they claim.
"This shows weaknesses in the security arrangements of the state agencies and the determination and commitment of the extremist Taliban," he told AFP.
Taliban and Al-Qaeda rebels who fled Afghanistan after the 2001 US-led invasion have carved out boltholes in the remote Pakistani mountains.