Dozens of anguished parents and teachers, some in tears, gathered Wednesday at a school in Niger where a horrific blaze killed 20 pre-school children who were trapped in the flames.

The young victims -- aged between three and five -- perished when the fire tore through buildings made of wood and straw in an impoverished area on the outskirts of the capital Niamey on Tuesday.

Wiping away large tears with her veil, the school's director Habiba Gaya told AFP that all of Niger was in "total mourning".

"The little children, innocents, were really burned alive in this fire," she said, explaining that while older children were able to make it out, those aged five and under were not.

"They were little so they weren't able to run."

Only the remains of desks and corrugated metal sheets were still visible among the debris, with charred books, pencil cases and back-packs scattered among the ashes.

"The flames were carried from classroom to classroom by the wind," said Balaraba Ibrahim who lives nearby.

Her five-year-old niece Yasmina perished in the flames.

"She had come home and then she went back to school. It's almost as if she was answering the call of death," Ibrahim said, breaking down.

Niger, which ranks as the poorest country in the world under the UN's 189-nation Human Development Index, often resorts to putting classrooms in makeshift huts where children sometimes sit on the floor.

The mother of another victim, seated in the courtyard near other more solidly built classrooms that escaped damage, struggled to accept her loss.

"Allah wanted this to happen and there is nothing we can do about it," she said, clutching prayer beads.

Map of Niger locating Niamey where the blaze occurred
Map of Niger locating Niamey where the blaze occurred AFP / STAFF

The tragedy took place in the poor "Pays-Bas" neighbourhood that was built in a former clay quarry near Niamey airport.

The cause has not yet been determined, and security forces have blocked off the scene while investigators searched for evidence.

Behind police tape, local residents gathered in anguish to look over what was left of the school buildings, some with their head in their hands.

"Around 20 children were trapped in the blaze," fire service commander Sidi Mohamed said on public television on Tuesday.

"Rescuers set off rapidly and the fire was put out... but the intensity of the fire was enormous," he added.

"The children were not able to escape."

"This is the worst thing that has ever happened at a Nigerien school -- 20 children burned alive in no time. It's a huge loss for Niger," lamented local resident Amadou Seyni.

Fires are frequent in the West African country but rarely claim lives.

School director Gaya said classrooms should not longer be housed in huts.

"There are plenty of empty lots the state could give us to build schools," added Ibrahim, the aunt of one of the victims.