"Five people have been killed and three injured this (Saturday) morning when workers were unloading some material imported from China," district mayor Rawalpindi Tariq Kiyani said.
"The material being unloaded was to be used in fireworks at marriage parties," Kiyani added.
The fireworks caught fire due to the negligence of workers, he said.
"A body has been found and an injured (person) has been shifted to hospital," an official of private charity Edhi Welfare Trust said.
"We are facing difficulties in rescue work as a huge fire has not been controlled yet," he said.
A police official at an emergency centre said: "There was a blast in the area at 04:50 GMT. The blast occurred in a wheat flour mill."
Officials said the fireworks were being stored in a room at the flour mill.
Witnesses said the blast was huge and was heard some three kilometres away.
Several cars were damaged and windows of nearby houses were shattered by the blast, witnesses said.
Fire engines were trying to extinguish the blaze, while ambulances were attempting to remove the injured and dead.