The blaze was caused by an electrical issue and that further investigations were ongoing, police spokesman Moses Carter said.
"The kids were learning the Quran when the fire broke out," he added.
Carter had originally said 30 children were killed before revising the death toll down to 27. Two survivors were taken to the hospital, he said.
The fire started late on Tuesday in the suburbs of the capital Monrovia, President George Weah said in a tweet.
"My prayers go out to the families of the children that died last night in Paynesville City," Weah said. "This is a tough time for the families of the victims and all of Liberia."