ISLAMABAD, Pakistan (CNN) -- Eight cadets and staff members were killed in Pakistan during an an eight-hour standoff Monday with gunmen who stormed a police training center in Lahore, said Gen. Athar Abbas, a military spokesman.

Police fire into the air after retaking the police training center in Lahore attacked by militants.

The militants had been holed up on the top floor of a three-story building, said Rehman Malik, the head of the country's Interior Ministry.

Security forces gained control of the first two floors and eventually made their way to the top, finally taking control of it and arresting the gunmen Monday afternoon.

Television pictures showed security forces firing into the air from the roof of the building after the firefight.

"The operation is over. Four terrorists were killed and three arrested," Interior Ministry Secretary Kamal Shah told Reuters. Malik and Abbas confirmed the figures.

Abbas added some of the dead militants blew themselves up.

The gang of seven gunmen stormed the academy in the Manawan area of the eastern Pakistani city, said Malik.

Abbas had previously said 30 people were killed. He cited the error on wrong information by his sources at the scene. Watch more about the attack »

At a news conference Monday night, Malik named the leader of the Pakistani Taliban, Baitullah Mehsud, and his followers as the prime suspect in organizing the attack. Mehsud is also accused of plotting the assassination of former PM Benazir Bhutto.

At least 78 people were wounded in the attack, authorities said.

Don't Miss

Lahore is the same city where gunmen opened fire March 10 on a bus carrying members of the Sri Lankan national cricket team on their way to a stadium for a match. The well-coordinated attack wounded at least eight members of the team and killed a driver and six Pakistani police officers.

In Monday's incident, the attackers hurled grenades, then stormed the compound and opened fire while officers were taking part in their morning drill.

About 800 officers train at the facility, but authorities could not say exactly how many were inside at the time.

The attackers, some in police uniforms, took dozens of officers hostage, said Asim Rizwan, spokesman for governor of Punjab -- the province where Lahore is located.

Paramilitary forces and the army descended on the scene. Every few minutes, the gunmen detonated explosives or fired on reporters and police personnel outside, sending them scurrying for cover.

Angry onlookers pumped their fists in the air and cheered as police led away a suspect they had captured. He had on him a grenade and a knife, officials told CNN.