Plumes of black smoke billowed from the Z121 military facility, around 120 kilometres north of Hanoi, as fireworks exploded uncontrollably for several hours, witnesses said.
"Twenty-one people are dead and 98 others are injured -- most of them have sustained burns," a military rescue official told AFP by phone, requesting anonymity and raising an earlier toll of seven dead.
The explosion prompted the evacuation of some 2,000 people living near the area.
"The first blast was at 7:55 am -- and then there were continuous explosions for some hours," Phi Xuan Trung, chairman of the local Khai Xuan commune, was told the VNExpress news site.
More From This Section
"There was a strong smell of gunpowder, the ground was shaking many kilometres away," he added.
Residents in Thanh Ba district -- where the complex is located -- also said they felt the ground shake during the powerful repeated explosions.
Loudspeakers urged people within 15 kilometres of the military facility to leave the area.
One local resident told AFP that locals have fled to the Viet Tri township, about 40 kilometres away.
"We have received warnings from authorities that there could be further explosions which could be very destructive," he said, speaking on condition of anonymity.
In 2010, fireworks being prepared at Hanoi's My Dinh stadium for use in the city's 1,000th anniversary celebrations exploded, killing three foreigners and one Vietnamese national.