Five people died and six were injured in an explosion at a fireworks factory on Monday near Zaragoza in northeastern Spain, officials said.