As the flames engulfed the building, the boys cried for help. The teens pressed their faces to the windows of their school dormitory, begging for rescue.

They couldn't escape the three-story building, witnesses said, because there were bars on most windows. “The children were crying for help, but I couldn’t help them as the door was already on fire,” one neighbor told Reuters. The man, Hazin, said his family called the fire department after hearing screams. “I saw their little hands out of the grilled windows; crying for help,” added local Nurhayati Abdul Halim to the Associated Press. " I heard their screams and cries but I could not do anything.”

At least 21 boys, ages 13 to 17, and two teachers were killed in the blaze Thursday at the Darul Koran Ittifaqiyah school in Kuala Lumpur, according to media reports.

The fire broke out around 5:45 a.m. at the top floor of the dorm. Most of the students were asleep in bunk beds in rooms where metal grills covered most windows. There was only one door in and out. Some boys were able to open one window, witnesses said, and about 14 escaped that way.

Mohamad Arif Mawardi, 24, was asleep on one of the building's lower floors when the fire started. He was awakened by screaming and managed to escape. “We wanted to help the others, but we couldn’t because the fire was rampant,” Arif told Reuters. “There was nothing we could do.”

Firefighters said it took an hour to extinguish the blaze. Once inside, emergency officials described blackened rooms, charred bed frames lining the walls and burned bodies huddled in corners.

Fire department official Soiman Jahid told Reuters that the fire might have been caused by a short circuit or mosquito-repellent coil.

Malaysian officials say they're investigating the incident. They noted that the original architectural design for the dorm included two staircases for exit, but a wall made it impossible for students to access the second exit. According to the school's principal, the students were being housed in the dorm temporarily while the school underwent construction. They were to move back into the main school later this month.

The incident has renewed calls for greater scrutiny and regulation of “tahfiz” schools. There have been 211 fires at private Islamic centers since 2015. In 1989, 27 female students at a private Islamic school were killed when their residence hall was set on fire.

Officials said that they've already launched an investigation. “We found that there was some security features that should have been complied with but weren't,” Zahid told reporters outside the school, according to Reuters.

In the hours after the fire, the boys' relatives gathered outside the school. “The pupils all got locked in and they couldn’t escape and got burned,” Nadia Azalan, the sister of a 13-year-old victim, told Reuters. In tears, she gathered with family members outside the burned building. “Safety should come first,” she told reporters.