Senior Pakistani figures have been attending funerals for 61 people killed when militants stormed into a police college in Quetta in Pakistan.
Two of the attackers died as they detonated suicide vests and a third was shot dead by security forces, while fleeing cadets jumped from the roof.
The so-called Islamic State group and a faction of the Pakistani Taliban both claim to have carried out the attack.
The Pakistani authorities have blamed the militant group Lashkar-e-Jhangvi.
Witnesses said the three masked gunmen had opened fire in the sleeping quarters of the academy in the south-west of the city, where some 700 recruits were based.
"They... knocked at the locked rooms and told the cadets that they were from the army, and when they opened the doors, they fired at them," a 22-year-old cadet called Hikmatullah told the AFP news agency from his hospital bed.
"They kicked our door and tried to break it and they started firing from the windows. Two of our colleagues were injured," another eyewitness, Asif Husain, told the Associated Press.
Video of the aftermath showed blackened walls and charred beds.
Most of the dead were police cadets and guards.
Some military personnel were also killed in the four-hour gun battle that eventually ended one of the deadliest attacks against a security installation in the country's history.
M Ilyas Khan, BBC News: 'Complex existential struggle'
Quetta is no stranger to militant attacks, but unlike in the past when militants used to mainly target Shia Muslims, they are increasingly willing to hit any soft target with multiple casualties.
This has led to two developments: Pakistani officials have started to accuse Pakistan's arch rival, India, of using Afghan territory to foment trouble in Balochistan; and the international community has increased its focus on the Quetta-based sanctuaries of the Afghan Taliban.
Many point out that Quetta seems to have finally landed at the centre of a complex existential struggle involving regional powers and a confusing array of militant networks.
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.
The Reuters news agency said it had been shown a photograph of one of the dead gunmen, apparently taken by a policeman inside the college, which bore a resemblance to one of the men in the Amaq image.
However, a faction of the Pakistani Taliban, known as the Hakimullah Group, also issued a statement claiming responsibility - and the Karachi-based Express Tribune newspaper reporter that a previously unknown group calling itself the Karachi Taliban had said it was behind the attack.
Earlier, officials blamed a faction of the Lashkar-e-Jhangvi militant group, and said the attackers "were in communication with operatives in Afghanistan".
Lashkar-e-Jhangvi is a Sunni militant group which has targeted minority Shia Muslims in the past, and is known to have worked with elements the Pakistani Taliban.
IS formed a branch for Afghanistan and Pakistan in January 2015 under Hafiz Saeed Khan. He was killed in a US drone strike in July this year.
Quetta, the capital of Balochistan province, has seen similar attacks by both separatists and various Islamist militant factions in recent years.
IS said it also carried out a suicide bombing that killed 88 people at a hospital in Quetta in August, but that too is disputed, with another faction of the Pakistani Taliban, Jamaat-ul-Ahrar, saying it was behind the attack.
The Pakistani military has been conducting operations against militants in volatile tribal areas near the Afghan border.
Balochistan Police College
- 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.
Are you in Quetta? Have you been affected by the attack? Let us know about your experiences. Email email@example.com with your stories.
Please include a contact number if you are willing to speak to a BBC journalist. You can also contact us in the following ways:
·WhatsApp: +44 7525 900971
·Send an SMS or MMS to 61124 or +44 7624 800 100