Police in Barcelona have detained a man after shooting at a truck loaded with butane gas canisters that was speeding the wrong way along a highway.

They opened fire on the vehicle as it headed towards the Spanish city's harbour on Tuesday, officials said.