MADRID — An explosion and fire at a petrochemical factory in Catalonia on Tuesday killed at least one person and injured several more, prompting officials to block roads, suspend rail service and order nearby residents to stay inside.

The shock waves from the initial blast were felt several miles from the factory, the authorities said, and the one fatality was reported in a building damaged by tremors.

The blast occurred at about 7 p.m. at a factory housing the Iqoxe company on the outskirts of Tarragona, a city whose metropolitan area includes several hundred thousand people.

The factory is Spain’s only producer of ethylene oxide, which can be transformed into ethylene glycol, a chemical that is used to help manufacture a wide range of products, including antifreeze, packaging film, plastic bottles and polyester fibers for clothing.