More than 100 people were also injured as commandos conducted a five-hour operation to rescue cadets who being held hostage inside the complex.

Major General Sher Afgan, Inspector General of the Frontier Corps (FC), said after the operation had ended that six terrorists carried out the attack, three of whom were wearing suicide vests.

"In the early morning, we have the latest death toll of 58 people who died during the attack last night," doctor Nasir Sumalani at Quetta's government hospital, told AFP. Sarfraz Bughti, the home minister of Balochistan province, said 118 people were wounded.

At least three blasts had been heard, shaking nearby buildings in Quetta.

Mr Bughti, the home minister of Balochistan province, said the gunmen had attacked a dormitory inside the training facility while cadets rested and slept. All of the cadets were freed in the operation.

The Quetta police training centre has been attacked Credit:
TWITTER

Sanaullah Zehri, the chief minister of Balochistan, said the government had received intelligence reports a couple of days earlier of the presence of militants who had entered Quetta to carry out subversive activities.

An eyewitness told local media outside the police training centre: "I saw two to four gunman, who were masked, entering the police training centre... They started indiscriminate firing inside the hostel".

Pakistani army soldiers arrive at the Balochistan Police Training College in Quetta Credit:
AFP

He said that "terrorists rushed towards the hostel area.. and were firing with the Kalashnikov guns".

At least seven policemen were injured in the attack on the training centre, which is on Saryab road in Quetta.

The attackers entered the complex through the front gate at around 11.30pm local time.

Earlier on Monday, two gunmen on a motorcycle killed a police intelligence officer in the country's northern Khyber Pakhtunkhwa province, said Khalid Khan, a local police officer.

An injured cadet is carried away for treatmentCredit:
EPA

Mr Khan said the attackers fled the scene after killing the officer, who had been on his way to work in the provincial capital of Peshawar.

The Pakistani Taliban claimed responsibility for that attack. The group's spokesman, Muhammad Khurasani, said in a statement that the shooters returned to their hideout after the attack.

Pakistan has carried out military operations against militants in tribal areas near Afghanistan and in cities across Pakistan, but extremists are still capable of staging regular attacks.