Police have recovered two bodies and the rescue work is continuing in the factory in Tiruchirappalli, a city in Tamil Nadu state.
The fire has been extinguished.
The cause of Thursday's fire is being investigated. According to the Press Trust of India, the 25-year-old factory manufactured explosives for deepening and widening water wells in the rocky region.
PTI says a series of blasts in the factory created panic among people living in the area.
Tiruchirappalli is 325 kilometers (200 kilometers) south of Chennai, the Tamil Nadu state capital.