At least 58 cadets and guards have been killed after militants attacked a police college in the Pakistani city of Quetta, officials say.
Three militants wearing suicide bomb vests entered the college late on Monday, reportedly taking hostages.
A major security operation lasted for hours and all attackers were killed.
No group has said they carried out the assault, but Quetta has seen similar attacks by separatists and Islamist militants in recent years.
Hundreds of trainees were evacuated from Balochistan Police College as troops arrived to repel the militants. Local media reported at least three explosions at the scene.
“I saw three men in camouflage whose faces were hidden carrying Kalashnikovs,” one cadet said according to AFP news agency. “They started firing and entered the dormitory but I managed to escape over a wall.”
The police academy is home to hundreds of students and many of the cadets who died were killed in the blasts, said Major General Sher Afgan of the Frontier Corps.
The exact sequence of events is unclear but there was intermittent exchange of fire between the attackers and security forces for several hours, according to Dawn newspaper. There were also reports of a hostage situation.
More than 100 people, mostly trainees, were injured.
Pakistan’s army and the paramilitary Frontier Corps took part in the military counter-operation, which Balochistan provincial home minister Mir Sarfaraz Ahmed Bugti said was now over.
Two of the militants died after detonating their bomb vests and one was killed by security forces.
Officials blamed a faction of the Lashker-e-Jhangvi militant group and said the attackers “were in communication with operatives in Afghanistan”.
Pakistani army soldiers enter the Balochistan Police Training College in Quetta on October 24, 2016, after militants attacked the police academy.Image copyrightAFP/GETTY IMAGES
Located about 13km from Quetta city in an area called Sariab, one of the most sensitive areas of Quetta.
About 600 cadets stay in dormitories at college, according to local media.
It has come under attack twice before. In 2006 six policemen were killed in five powerful explosions at the academy.
In 2008 gunmen fired rockets into the grounds and then attacked the college.
Quetta is the capital of Balochistan province, which is battling an insurgency as well as Islamist militants, with violent attacks common.
Earlier in the day, two customs officers were shot dead and another critically wounded in Surab, south of Quetta.
In August, 88 people were killed in separate bomb attacks targeting a hospital and lawyers in Quetta.
The Pakistani military has been conducting military operations against militants in volatile tribal areas near the Afghan border.