At least 23 people, mostly teenage boys, have died after being trapped in a burning Islamic school dormitory.

Locals on the outskirts of Malaysia's capital Kuala Lumpur described being unable to save the boys as they begged for help from behind barred windows.

Firefighters were called to the three-storey building at around 5.40am local time on Thursday and took an hour to put out the blaze.

Suspected to have been caused by an electrical short-circuit or a lit mosquito repellent coil, the fire broke out in the sleeping quarters on the school's top floor.

The blaze began near the door of the dormitory - the only entrance - which along with the window grills, left the students unable to escape, according to fire officials.


Image: At least 24 died in the school's charred interior

Police found 23 charred bodies among blackened bunks, 21 of them boys aged 13 to 17, and two teachers.

Earlier reports suggested there were 24 victims in total.

A local resident revealed the school had been operating for the last year.

"I saw their little hands out of the grilled windows; crying for help," she said.

"I heard their screams and cries but I could not do anything. The fire was too strong for me to do anything."

Another said: "The children were crying for help, but I couldn't help them as the door was already on fire.

"I only managed to save a few of the kids who jumped out the window."

Image: The school was claimed to have been unlicensed

Kuala Lumpur police chief Amar Singh said the victims were likely to have suffocated from smoke inhalation, adding: "The bodies were totally burnt."

It was claimed the bodies were piled on top of each other, suggesting a possible stampede as the victims tried to escape the flames.

Another 14 students and four teachers were rescued, with six taken to hospital in a critical condition.

The Darul Quran Ittifaqiyah is a private Islamic boarding school, known as a "tahfiz", where Muslim children - mainly boys - study and memorise the Koran.

The school was said to have just been submitted to the city council for building safety approval, while - like many religious schools - it was claimed to be unlicensed with local authorities.

Local media said 211 fires in private Islamic centres had been recorded since 2015.