Islamic State has claimed responsibility for an attack in which at least 59 people were killed at a police academy in Pakistan.
Gunmen stormed the training college near Quetta, the provincial capital of Baluchistan, opening fire and detonating explosives.
More than 100 others have been injured, some of them critically.
Between four and six gunmen raided the training centre, attacking a dormitory where up to 250 police trainees were resting.
IS-linked news agency Amaq said the attack was carried out by "Islamic State fighters".
However, Major General Sher Afgan blamed the killings on the Lashkar-e-Jhangvi (LeJ) militant group.
Pakistani police and paramilitary forces exchanged fire with the gunmen for several hours after the attack amid reports that a number of trainees were taken hostage.
One of the police trainees told Pakistan's Geo television: "They were rushing toward our building firing shots so we rushed for safety toward the roof and jumped down in the back to save our lives."
Another cadet said: "I saw three men in camouflage whose faces were hidden carrying Kalashnikovs.
"They started firing and entered the dormitory but I managed to escape over a wall."
At least one of the attackers was killed in the counter-terror operation and two detonated their explosive vests, according to Baluchistan home minister Sarfaraz Bugti.
He said security forces have now completed their operation, but are still engaged in the clean-up process.
Firefighters were sent to the academy to put out blazes set off by the attackers' suicide vests.
The compound is home to around 700 recruits, Mr Bugti said.
Most of those taken to hospital had gunshot wounds, although some suffered injuries after jumping off the roof of the dormitory to escape the gunmen.
Pakistani interior minister Chaudhry Nisar Ali Khan said: "This war isn't over.
"The enemy is weakened, but not eliminated."
The attack came hours after gunmen shot and killed two customs officers and wounded a third near the town of Surab, about 90 miles south of Quetta.
Baloch separatist groups in Baluchistan have claimed similar hit-and-run attacks on security forces and government officials in the past.
Islamist militants also have a presence in the province, which borders Afghanistan.
In August, Islamic State claimed responsibility for an attack that killed 70 people at a hospital in Quetta.