Most of the dead and injured were locals who had been ransacking the factory after it was taken over Sunday by militants, security officials said.
The explosion took place in Abyan Province, they said.
It comes after months of demonstrations against Yemen's President Ali Abdullah Saleh, and a weekend of violence between government forces and the local al Qaeda group.
Fighting over the past two days between Yemeni security forces and members of al Qaeda in the Arabian Peninsula left people on both sides dead, Yemeni security forces said Sunday.
Saleh has been fighting to hold onto power, arguing that he is best equipped to lead the fight against Islamists.
Three "al Qaeda terrorists were killed" and six others were arrested in Lawdar district, Yemen's official news agency Saba reported Saturday.