Nearly 40 pupils were reported killed over the weekend at a school in western Uganda by rebels linked to the Islamic State group (IS).
A further eight people remain in a critical condition after the attack on Lhubiriha secondary school in Mpondwe.
Five militants carried out the attack at around 23:30 (20:30 GMT) on Friday, entering dormitories where the pupils lived.
The Allied Democratic Forces (ADF) – based in the Democratic Republic of Congo (DRC) – have been blamed.
Warning: Some people may find details in this story distressing.
Uganda’s information minister said 37 students were confirmed to have been killed, but did not give their ages.
Twenty of them were attacked with machetes and 17 of them burned to death, Chris Baryomunsi told the BBC.
Survivors said the rebels threw a bomb into the dormitory after the machete attack. It’s not clear if this resulted in a fire in the building which was reported earlier.
Six students were also abducted to carry food that the rebels stole from the school’s stores, he added. The militants then returned across the border into the DRC.
More than 60 people are educated at the school, most of whom live there.
Some of the bodies are said to have been badly burnt and DNA tests will need to be carried out to identify them.
Soldiers are pursuing ADF insurgents towards the DRC’s Virunga national park – Africa’s oldest and largest national park which is home to rare species, including mountain gorillas.
Militias including the ADF also use the vast expanse, which borders Uganda and Rwanda, as a hideout.
“Our forces are pursuing the enemy to rescue those abducted and destroy this group,” defence spokesperson Felix Kulayigye said on Twitter.
The Ugandan army has also deployed helicopters to help track the rebel group over mountainous terrain.
Uganda and the DRC have held joint military operations in the east of DR Congo to prevent attacks by the ADF.
Security forces had intelligence that rebels were in the border area on the DRC side for at least two days before Friday night’s attack, Maj Gen Olum said.
But local residents have criticised the authorities for not being prepared for an attack.
“If they are telling us the borders are secure and security is tight, I want the security to tell us where they were when these killers came to kill our people,” one resident told reporters.
The deadly episode follows last week’s attack by suspected ADF fighters in a village in the DRC near to the Ugandan border. Over 100 villagers fled to Uganda but have since returned.
The attack on the school, located less than 2km (1.25 miles) from the DRC border, is the first such attack on a Ugandan school in 25 years. (BBC NEWS)
We’ve got the edge. Get real-time reports, breaking scoops, and exclusive angles delivered straight to your phone. Don’t settle for stale news. Join LEADERSHIP NEWS on WhatsApp for 24/7 updates →
Join Our WhatsApp Channel