(CNN) Two teenagers have been charged with 23 counts of murder in Malaysia for allegedly lighting a fire that killed 21 children at an Islamic school in Kuala Lumpur in September.

Two adults also died in the blaze that engulfed Darul Quran Ittifaqiyah Tahfiz religious school in the early hours of September 14.

The two suspects, both aged 16, haven't entered a plea, according to state news agency Bernama. In Malaysia, a murder charge carries an automatic death sentence, but in cases involving juveniles, the maximum penalty is prison.

The boys were also charged with drug-related offenses, as were four other suspects. One 16-year-old was released without charge due to lack of evidence, deputy public prosecutor Othman Abdullah said.

Two days after the fire, Malaysian Prime Minister Najib Razak announced special funding of RM30 million ($7 million) to upgrade religious schools across the country.

Authorities have conducted fire safety inspections at 104 of 402 registered religious schools in the state of Selangor, according to Bernama.

Several were found to have faulty wiring and no fire extinguishers, Selangor Fire and Rescue Department director Azmi Osman was quoted as saying.

Authorities are also inspecting a number of unregistered schools, he said.

Family members cry outside the school.

'So many involved'

Sharifuddin Musa's son Mohammad Shahir was inside the building when it was allegedly set alight.

The 11-year-old survived the blaze but is still in intensive care. He suffered internal injuries, broken bones and burns to 20% of his body in the fire, Musa told CNN.

Musa was at the court Thursday to find out "who was involved" in the crime.

"We want to know the details. We want to know what is the action to be taken against the perpetrators. I will follow the proceedings.

"I'm very sad because there are so many involved," Musa said.

He said his son still wants to study at the religious school.

"We see that since he studied there, there have been a lot of changes in him. He is happy and has many friends. We can see that he could manage himself better at the school. So the family is encouraging him."

Trapped, burned alive

As the fire engulfed the building, witnesses reported being awoken by cries for help from children who appeared trapped by metal window grills.

"I saw children kicking on the grill, but they couldn't get out. My friends and I rushed over and tried to reach them, but we couldn't get in," one witness, Shahirman Shahril told CNN.

When emergency responders arrived, "almost 90% of the building was already on fire," a fire and rescue department official told reporters.

A forensic police officer investigates burnt windows at an Islamic religious school following the fire.

Many of the victims were found piled on top of each other, while others were discovered in front of the main door, fire and rescue department official spokesman Soiman Jahid told reporters.

One of two fire exits in the building had been blocked by renovations taking place on the second floor, Jahid told CNN.

"The firemen could hear cries for help from inside the building," spokesman Soiman Jahid said. "The first team from (the) fire station managed to save five of the children from the lower level."

People console each other outside an Islamic religious school following the fire.

School shouldn't have been open, official says

The building where the fire erupted was new and had been used as a religious school specializing in Quranic studies, said Deputy Inspector General of Police Noor Rashid Ibraham.

But the school's license had been under review by authorities, and the facility should not have been in operation, said Malaysia's minister of urban well-being, housing and local government, Noh Omar.

The charges came shortly after a fire partially gutted another religious school in Serembam, around 20 miles south of the capital on Thursday.

Local press reported that the fire department received the distress call at around 1.50 a.m. local time (1.50 p.m. Wednesday ET).

All 37 students housed in the school's hostel managed to escape, and three had to be treated for smoke inhalation.