Pakistani commandos re-took control of a police academy in Lahore today after militants rampaged through the complex, killing at least eight cadets and wounding scores before holing up inside for hours.
"The operation is over. Four terrorists were killed and three arrested," Interior Ministry Secretary Kamal Shah told Reuters.
Shah said 89 policemen were wounded, and Interior Ministry chief Rehman Malik said all those taken to hospital were being screened to ensure no militants were hiding among them.
Punjab police chief Khawaja Khalid Farooq and a military spokesman said eight recruits were killed though there had been reports the toll would be higher as there were 900 cadets in the academy at the time of the attack.
Three of the militants blew themselves up during the final assault, and commandos rescued 10 police being held hostage.
Television news channels showed jubilant police shouting praise to Allah, making victory signs with their hands, and firing in the air in celebration minutes after a fierce firefight inside the main academy building.
The latest brazen attack will heighten fears about mounting insecurity in nuclear-armed Pakistan. The assault came less than a month after gunmen attacked Sri Lanka's cricket team in Lahore, killing six police guards and a bus driver. Those gunmen escaped.
Islamist militants have launched a campaign of violence to destabilise the Muslim nation of 170 million people, and the one-year-old civilian government's ability to meet the challenge.
U.S. President Barack Obama made support for President Asif Ali Zardari's government a centrepiece of a review of policy towards Afghanistan and Pakistan that was announced on Friday.
The principle objective of Obama's strategy is the annihilation of al Qaeda in the two countries.
One witness told Reuters the gunmen attacked in groups of three or four from all sides as the attackers struck while police recruits were going through their regular morning drill on the parade ground at around 7:30 a.m (0230 GMT).
"A grenade hit the platoon next to ours ... then there was continuous firing for about 20 minutes," the policeman told reporters gathered round his hospital bed.
"A man in light-coloured clothes - I think they were white - stood in front of us, firing at us. They wanted to do as much damage as possible."
The gunmen then went on to occupy the academy's main building, and another wounded policeman recounted how he jumped from a second floor window to escape when the gunmen burst into a room and began firing.
Just before 4 p.m., commandos launched an operation to retake the building, at the climax of a joint operation by the army, paramilitary rangers and a crack police squad.
"Our forces stormed the top floor where they were holding positions," Major-General Shafqaat Ali said.
"The operation is over the building is in our control."
The siege had lasted nearly eight hours, with security forces firing from rooftops of nearby buildings, while gunmen returned fire and threw grenades, at one point forcing an armoured personnel carrier to retreat.
Before the siege ended, the police chief said one of the suspected attackers had been caught. Footage showed police kicking a bearded man on the ground before leading him through a throng of journalists.
Reports said the suspect was caught with a grenade in his possession and had an Afghan passport, though a cadet who fled the carnage said he heard the attackers speaking a dialect common to southern Punjab. The eastern city of Lahore is the capital of Punjab province.
If those accounts are correct it would point to a nexus between militants from Afghan border areas in the northwest and Punjabi jihadi groups, like Lashkar-e-Jhangvi, that have forged ties with al Qaeda.
LeJ was implicated in several assassination attempts on Pakistan's former president, General Pervez Musharraf, and was blamed for a suicide bomb attack on the Marriott Hotel in Islamabad last September.
Despite the attack in Lahore, Pakistani stocks and the rupee firmed as investors registered relief that a recent political crisis had subsided.
Militant violence has surged in Pakistan since mid-2007, with attacks on security forces and government and Western targets.
While there have been attacks in all Pakistan's big cities, most violence has been in the northwest, near the Afghan border.