At least 59 cadets and guards have been killed in an attack by militants on a police college in the Pakistani city of Quetta between Monday night and Tuesday morning.
Officials say three militants wearing suicide vests entered the college in the middle of the night and opened fire on the cadets who were fast asleep.
The Pakistani military forces later responded and after a major security operation that lasted for hours, one of the attackers was shot dead, while the two others were said to have blown themselves up.
So-called Islamic State, IS, claimed responsibility for the attack, although officials have blamed another militant group, Lashkar-e-Jhangvi.
Quetta, the capital of Balochistan province, has seen similar attacks by both separatists and various Islamist militant factions 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 newsmen.
“They started firing and entered the dormitory but I managed to escape over a wall.”
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 some reports.
There were also reports of a hostage situation.
More than 100 people, mostly trainees, were injured.
Pakistani media highlighted the nation’s poor security situation after the attack, with leading TV channels changing their logos to black in a mark of respect for the victims.
Officials blamed a faction of the Lashkar-e-Jhangvi militant group and said the attackers “were in communication with operatives in Afghanistan”.
However, IS said on its Amaq news agency that its fighters had carried out the attack, releasing an image purported to be of the three gunmen.
IS formed a branch for Afghanistan and Pakistan in January 2015 under Hafiz Saeed Khan, who was killed in a US drone strike in July this year.
The first suspected IS attack in Pakistan was in April 2015, when three soldiers were killed.
ISIS also claimed an attack on a bus in Karachi that killed 45 people, although the Pakistani Taliban splinter group Jundullah also said it was responsible.