The children were sleeping in a building attached to a mosque at a religious school in Paynesville City when it caught fire at about 11 a.m. Liberia time, Presidential Press Secretary Isaac Solo Kelgbeh said.
The children, some as young as 10, were not able to escape the building because there was no fire exit and there were security steel bars on the windows, Kelgbeh told CNN.
Two teachers are also among the dead. While two survivors were taken to a local hospital and remain in a critical condition.
Liberia's President George Weah visited the site Wednesday morning and said, "I was touched by the terrible news and decided to rush here to see for myself the families of children and the community leadership to extend my sympathy. It is saddening even when a single citizen dies; what more about 28 children, potential leaders, who were aspiring for a better and prosperous future. "
The President said he would launch an investigation into how the fire started.
The victims will be buried Wednesday with Islamic funeral rites, Kelgbeh said.