Three people were reportedly injured in a chemical explosion in northern Spain, which created a toxic orange cloud. Residents in towns around Barcelona were told to stay indoors. The restrictions were lifted after about four hours.

The accident in northeastern Spain appears to have been caused by two chemicals accidentally mixing while on their way during delivery, the regional government in Catalonia said, as cited by Reuters.

An explosion in a chemical company caused two wounded and a toxic cloud in #Igualadahttp://t.co/5fq6eLEFsqpic.twitter.com/lQmzgb4qLY — Sir Arnold Robinson (@uk_expat) February 12, 2015

The explosion and fire happened at Simar, a chemical distribution company.

The explosion resulted in a thick orange cloud, which prompted government warnings for residents in nearby towns to stay indoors and shut their windows. Authorities also shut down several roads.

"Unfortunately there isn't much wind in the area so the toxic cloud is taking longer to disperse," the Catalan Interior Ministry's Ramon Espadelar told El Pais.

The six towns are home to thousands of people. Igualada, Catalonia, is still largely engulfed in the orange mist.

One of the two chemicals involved was nitric acid, which is corrosive and toxic.

The explosion took place at 9:00 local time (10:00 GMT) Thursday, according to the daily La Vanguardia.

What led to the chemicals mixing was an accident during the unloading of the trucks. This caused a fire, injuring the people, whose condition is still not known, it reported.

The recommendation to stay indoors was partially withdrawn an hour later, Reuters reports. However, infants and the elderly were advised to be kept indoors in the six towns affected by the cloud.

Termina el confinamiento en los municipios de #Barcelona afectados por la nube tóxica http://t.co/B2v0TMNGhjpic.twitter.com/FK5aJm4eNJ — laverdad_es (@laverdad_es) February 12, 2015

Spain's emergency services have taken to Twitter, recommending that people remain calm. They discouraged citizens from going outdoors and taking pictures until the containment order is fully lifted.

#IGUALADA #SIMAR accidente laboral en empresa Población confinada A video posted by Newton, #cats & #DiY (@laprofe987) on Feb 12, 2015 at 3:51am PST

The containment order was lifted about 13:40 local time (12:40 GMT).