Dozens of children were killed after a fire broke out at their religious school in Liberia on Wednesday.

According to Aljazeera the blaze started about midnight and gutted a dormitory and school building where students slept in Paynesville, on the outskirts of the Liberian capital, Monrovia, police spokesman Moses Carter said.

At least 26 young pupils and two teachers were killed, the president’s office said. Carter said 27 students – between the ages of 10-20 – perished in the fire.

“The kids were learning the Quran when the fire broke out,” he said.

The cause of the fire was under investigation.

Rescuers in white masks and surgical gloves carried the children’s bodies in bags from the burned-out building as crowds of people and relatives crushed together outside.

Parents at the scene wailed and wept as police fought a surging crowd to make way for ambulances taking away the bodies.

President George Weah visited the site in Paynesville.

“We are here to encourage parents of the victims to have strength because it is painful to lose your kids in this manner,” Weah told reporters at the scene.

“We extend our sympathy to the bereaved families. We don’t know the cause of the fire yet, but we will encourage our investigators to find how it happened.”

The Liberian authorities are all too familiar with deadly fires, often caused by malfunctioning generators, though “not on this scale”, said presidential spokesman Isaac Solo Kelgbeh.

Liberia declared a day of morning.