Officials arrested three former students believed to have started the blaze, which broke out minutes after midnight on Monday in a block that housed more than 60 pupils at St Bernard Secondary School in Rakai, the BBC reported.
Greater Masaka regional police commander, Latif Zaake, told local paper New Vision the security guard on duty at the time of the attack had also been taken into custody.
Local police commander Ben Nuwamanya said 20 students were taken to hospital where they remained in a critical condition with severe burns.
At least 40 other students “escaped with injuries of varying degrees”, the Ministry of Education said.
Henry Nsubuga, the school’s principal, said he suspected a group of students expelled from school for misconduct were behind the incident, New Vision reported.
Ugandan councillor Gerald Karasira told New Vision locals first battled the fire using sand, water and bricks as the school’s fire extinguishers had expired.
Rescuers were eventually forced to retreat and wait for firefighters, who arrived in the morning, due to heavy smoke inside the property and the locked doors.
“Had the firefighting truck been near within the district, maybe we would have saved lives and property,” Mr Karasira said.
Several senior government officials, including Uganda’s education and security ministers, visited the school to offer prayers for the victims in the wake of the attack, the BBC reported.
In 2008, a similar fire at a school dormitory near Kampala killed at least 19 students.