An explosion and fire at a fireworks factory on the western outskirts of Indonesia's capital killed at least 30 people and injured dozens on Thursday, officials said.

Television broadcast images of thick plumes of dark smoke billowing from a warehouse in the Tangerang district of Jakarta, an industrial and manufacturing hub on the island of Java.

Media, quoting witnesses, said there were two explosions, one at around 10 a.m. and then another about three hours later, both of which could be heard miles away.

Tangerang police chief Harry Kurniawan said the dead were discovered by his officers when they entered the factory warehouse, the Detik.com news portal reported.

Media images of the PT Panca Buana Cahaya Sukses warehouse showed smouldering ash and debris, with the roof completely missing.

The factory had been operating for only two months, media said.