He said that 20 of the hostages had been kept in a room, guarded by one of the fighters who was wearing a suicide vest.

The man was shot before he managed to detonate the vest, Abbas said.

'Successful operation'

The Rawalpindi assault came a day after a suicide car bomb killed 52 civilians at a busy market in the northwest city of Peshawar.

Kamal Hyder, Al Jazeera's correspondent in Islamabad, said the security operation was being portrayed as a success.

"The military is very confident they have been able to save a lot of the military personnel [held captive]," he said.

In depth

  Video: Pakistan army HQ attacked
  Profile: Pakistan Taliban
  Witness: Pakistan in crisis
  Riz Khan: The battle for the soul of Pakistan

"It is considered to be a successful operation. The military has taken back control of the area."

Gunfire and explosions were heard near the army headquarters just before dawn and, soon afterwards, reports from the Pakistani military said they had freed "most" of the hostages.

There was no immediate word on the number of people wounded, but a reporter with the Reuters news agency said that he saw three ambulances leaving the area.

A group of armed men, dressed as soldiers, attacked the army compound on Saturday, sparking a gunbattle that killed four fighters and six soldiers.

The remaining fighters took hostages, who Abbas earlier said were "security personnel", and barricaded themselves in a nearby office.

The military surrounded the compound and the ensuing siege lasted for more than 18 hours.

Taliban suspected

It was unclear who was behind the attack, Rehman Malik, Pakistan's interior minister,  pointed the finger at the Taliban.

"We are very sure it was done by the Taliban ... after having their back broken in Swat they wanted to react and they have reacted," he told Al Jazeera.

"All this leads to the South Waziristan. Now we have no option except to go into Warizistan."

Malik said that the fighters had spent months planning their assault.

"These terrorists had rented a house near Islamabad for the last two months preparing themselves," he told Al Jazeera.

"We recovered fuses that are used in suicide jackets from the house."

Attack warning

A police intelligence report obtained by The Associated Press news agency on Saturday had warned in July that members of the Taliban along with Jaish-e-Muhammad, a group based in the Punjab province, were planning to attack army headquarters after disguising themselves as soldiers.

The report was given to the AP by an official in the home affairs ministry in Punjab's home department.

A week ago, Hakimullah Mehsud, the newly appointed chief of Pakistani Taliban, told journalists summoned to a briefing in South Waziristan that the Taliban would launch more attacks on military, government and other targets in the country.

Fighters regularly attack army bases across the country and bombed a checkpoint outside the army compound in Rawalpindi two years ago - one of several major bombings to hit the garrison city in recent years.

But rarely has the Taliban mounted an armed assault in the city involving multiple fighters.