Heavily-armed militants wearing suicide vests stormed a police academy in Quetta, killing at least 61 people and wounding at least 117, Balochistan Home Minister Mir Sarfaraz Bugti said Tuesday, in the deadliest attack on a security installation in the country's history.

Three gunmen burst into the sprawling academy, targeting sleeping quarters home to some 700 recruits, and sent terrified young men aged between 15 and 25 fleeing.

Communication intercepts showed the attack was carried out by Al-Alimi faction of the Lashkar-i-Jhangvi (LJ) militant group, IG Frontier Corps (FC) Major General Sher Afgan said.

Separately, the militant Islamic State group claimed responsibility for the attack, according to the group's Amaq news agency.

The training centre houses at least 600 cadets. — AP

Most of the deaths were caused when two of the attackers blew themselves up. The third was shot dead by Frontier Corps (FC) troops. At least 117 people were injured.

“I saw three men carrying Kalashnikovs… they were in camouflage and their faces were hidden,” one cadet told reporters. “They started firing and entered the dormitory but I managed to escape by climbing over a wall.”

Bugti confirmed to reporters that there had been three attackers.

“They first targeted the watch tower sentry, and after exchanging fire, killed him and were able to enter the academy grounds,” he said.

"We have taken one of the suicide bombers' bodies into custody," Bugti told DawnNews.

The attack on the Balochistan Police College, around 20 kilometres east of Quetta, began at around 11:10pm Monday, with gunfire continuing to ring out at the site for several hours.

Major General Sher Afgan, chief of the paramilitary FC in Balochistan, which led the counter-operation, said “the attack was over in around three hours after we arrived”.

"The operation needed to be conducted with precision therefore it took us four hours to clear the area completely."

“There were three terrorists and all of them were wearing suicide vests,” he said. “Two suicide attackers blew themselves up, which resulted in casualties, while the third one was shot dead by our troops.”

He added that the militants had been communicating with their handlers in Afghanistan.

Afgan said communication intercepts showed the attackers belonged to LJ's Al-Alimi faction, which is affiliated with the Tehreek-i-Taliban Pakistan (TTP). The group itself, however, has not claimed the attack.

The area was plunged into darkness when a counter-offensive was launched, and security personnel threw up a cordon while ambulances zoomed in and out, taking the injured to hospitals. Military helicopters circled overhead.

The cadets were rescued from the college following an operation carried out by Special Services Group (SSG) commandos.

The training college is situated on Sariab Road, which is considered to be one of the most sensitive areas of Quetta. Militants have been targeting security forces in the area for almost a decade.

The training college has come under attack in the past in 2008 and 2006, with attackers firing rockets into the college playground. It covers about an acre of land located about 13 kilometres outside the main city of Quetta.

— AFP

'Darkness hindered operation'

The attackers entered the complex through the front gate after shooting the guard manning the check post.

A senior law enforcement agency's official said assailants had fired at the police training centre from five different points.

Two terrorists entered the premises after shooting at the guard manning the checkpost near the front gate, while the third reportedly climbed the rear wall of the police centre.

"Two attackers entered through the front gate," Senior Superintendent Police Operations Mohammad Iqbal had said earlier.

Iqbal said that the suicide jacket of one attacker was not detonated and his body was lying at the centre premises.

Initial investigations showed the terrorists had entered the hostel, he said. The SSP said that there had been trouble distinguishing friend from foe as it was dark at the time.

'The attackers were wearing shawls'

Eyewitness says he saw three terrorists enter the barracks

An eyewitness speaking to reporters after making a narrow escape said he saw three terrorists directly enter the barracks. "They started firing. We saw them and started screaming. We ran upstairs towards an exit."

He described the terrorists being covered in shawls.

The barracks and hostel blocks are situated deep inside the compound, making it hard to hear any sounds of gunshots from the building.

'Tried to break down our door'

Academy recruit recounts his experience.

Asif Hussain, a recruit at the academy, told DawnNews he was lying in bed and browsing Facebook on his cellphone when the attack began.

"We'd been told that if anything like this ever happens, we should hide ourselves under our charpoys and not show ourselves.

When the firing started, all of us lay down under our charpoys, turned off the lights and closed the door, he said.

"We heard a loud explosion downstairs. These people broke down the door and started shooting at them one by one.

"They tried to break down our door, but were unable to. Then they started shooting our windows in. They couldn't get in."

"Only two boys in our room were injured," he said.

Security beefed up at hospital

The injured cadets were brought to Civil Hospital. Those in critical condition were shifted to CMH Quetta.

Extraordinary security arrangements were made in and outside the Civil Hospital to prevent any untoward incident, especially in the wake of August 8 attack when a suicide attacker targeted the hospital.

An emergency was declared in all government hospitals of the provincial capital, with the injured shifted to Civil Hospital Quetta and the Bolan Medical Complex.

Injured rushed to hospital after attack

Forces rush to site of attack

Police Training College cordoned off

In August, a suicide bombing at a Quetta hospital claimed by the militant Islamic State group and the Jamaatul Ahrar killed 73 people, including many of the city's lawyer community who had gone there to mourn the fatal shooting of a colleague.

Balochistan is a key region for China's ambitious $46 billion China-Pakistan Economic Corridor (CPEC) infrastructure project linking its western province of Xinjiang to the Arabian Sea via Pakistan.

Security problems have mired CPEC in the past with numerous attacks, but China has said it is confident the Pakistani military is in control.