The blaze broke out at midday in the makeshift facility located in a residential area, killing 27 adults and three children, said Riadil Akhir Lubis, head of the provincial disaster mitigation agency.

Police are investigating the cause of the fire, he said.

"(The children) were probably not workers. Their parents, who lived nearby, brought them to work," said Irwan Syahri, head of the local disaster agency, told Metro TV.

A video circulated on social media showed emergency workers inspecting the site and what appeared to be charred bodies in the smouldering ruins.

Indonesia has a patchy industrial safety record. In 2017, a series of explosions and a fire killed 47 workers and injured dozens at a fireworks factory on the outskirts of Jakarta.