Two teachers have also been killed (Representational)

A fire at a Koranic school near the Liberian capital Monrovia has killed at least 26 children and two teachers, the president's office said on Wednesday.

Emergency services told President George Weah that 28 people died overnight, his spokesman Solo Kelgbeh told AFP, as the president visited the site in Paynesville, on the outskirts of the capital.

The fire struck while the children were asleep, said Fulani community official Amadou Sherrif.

"My prayers go out to the families of the children that died last night in Paynesville City as a result of a deadly fire that engulfed their school building," Weah tweeted.

"This is a tough time for the families of the victims and all of Liberia."

Relatives on Wednesday gathered outside the yellow and green entrance to the building, which housed a school and boarding school, whose sheet metal roof was burnt.