Gunmen stormed a police training centre in Pakistan's troubled Baluchistan province and detonated explosive vests, killing at least 48 trainees.
Baluchistan's senior health official, Noor Haq Baloch, said at least 116 people were wounded - mostly police trainees and some paramilitary troops.
One attacker was killed by security forces and two died when they detonated their explosive vests.
Major General Sher Afgan, chief of the paramilitary Frontier Corps, told reporters that the attackers appeared to be in contact with handlers in Afghanistan.
He said they belonged to the banned Lashker-e-Jhangvi group, an Islamic militant group affiliated with al Qaida.
Neither Lashker-a-Jhangvi nor any other group has claimed responsibility for the attack.
But the Islamic State group and breakaway Taliban faction Jamaat-ul Ahrar have claimed responsibility for past attacks in Baluchistan. Lashker-e-Jhangvi has mainly targeted members of the minority Shiite sect of Muslims.
The attack started when between four and six gunmen opened fire as they rushed the hostel at the police training centre in a suburban area of the provincial capital of Quetta.
"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," one of the police trainees told Geo television.
Security was tight on Tuesday morning around the training centre and hospitals.
Mr Haq said many of the trainees were killed when the gunmen detonated explosive vests. He said the death toll was expected to climb as many of the injured were in critical condition.
Baluchistan has been the scene of a low-intensity insurgency by Baluch separatist groups for more than a decade. Islamic militants also have a presence in the province that borders Afghanistan.
The provincial home minister, Sarfaraz Bugti, said one attacker was killed by security forces and two died when they detonated their explosive vests.
He said that about 700 trainees were at the base when it was attacked.
Footage shot by local television showed ambulances driving out of the main entrance of the training centre as fire engines rushed to put out blazes set off when the gunmen threw incendiary devices.
Most of those being treated at city hospitals had gunshot wounds, although some suffered injuries jumping off the roof of the hostel and climbing a wall to escape the gunmen.
Local television reported that two explosions were heard, but it was not immediately clear what caused them.
Violence is common in the province, and 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.
Earlier on Monday, two gunmen on a motorcycle killed a police intelligence officer in the country's north-western Khyber Pakhtunkhwa province.
The Pakistani Taliban claimed responsibility for that attack. The group's spokesman, Muhammad Khurasani, said 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.