The school, Darul Quran Ittifaqiyah, is a private Islamic center, known as a "tahfiz" school, for Muslim children, mainly boys, to study and memorize the Quran.
Firefighters rushed to the scene and the fire was out within an hour but it wreaked bad devastation.
It is learnt that numerous victims suffocated as they were trapped inside the room.
The blaze was reported was reported at around 5.40 am local time.
The disaster has renewed calls for greater scrutiny of so-called "tahfiz" schools, where students learn to memorise the Quran.
Images and videos circulating online showed the upper floor of the school, where students would have been sleeping, ablaze.
Prince William and Duchess Catherine are expecting their third child
The royal couple can also be seen as following in the footsteps of Queen Elizabeth II and Prince Philip , who have four children. Congratulations to the Duke and Duchess of Cambridge! 'The Queen and members of both families are delighted with the news'.
Fire officials said they suspected the blaze was caused by an electrical short circuit, or a mosquito repelling device.
Police are still confirming the final casualty toll and the cause of the fire.
Local media reports said the school could have been operating against government regulations, because its fire safety permit application was allegedly still pending.
The pre-dawn fire this morning at the religious school resulted in the deaths of 24 people, mostly students.
"I thought there were people fighting", the 46-year-old said. He says six students and a resident who went to help were hospitalized, with four of them in critical condition.
A fire department official, who declined to be named because he was not authorised to give a statement, said the bodies were piled on top of each other, indicating a possible stampede as people tried to flee the fire.
LTE Apple Watch battery life offers just one hour of call time
While developers had access to beta versions of the new software since WWDC, Apple didn't make it part of the public beta program. There is also elevated heart rate detection which alerts you when you are at rest but your heartbeat is up.
The dormitory had only one entrance, leaving numerous victims trapped, he said.
"Unfortunately there was only one entrance, so they could not escape. All of the bodies were found grouped together on each other", he added.
Shortly after the fire broke out, pictures started surfacing on the internet showing the charred building and ash-covered beds.
The Malaysian prime minister Mohd Najib Tun Razak tweeted "Innalillah".
"We identify with the families". It is one of the worst fires involving so many lives.
Kobach's unproven voter fraud claim is challenged by fellow Trump commission members
She suffered from dementia so serious that she "did not know what day it was let alone what was going on in the world". But as its work has progressed, Trump's voting commission has somehow managed to get even more embarrassing.