A gunman has opened fire in a Spanish supermarket.

The attacker, who was reportedly carrying gasoline and gunpowder, walked into the Mercadona shop, in the As Lagoas region of the northwestern region Ourense, before opening firing shots into the air.

Several shoppers were inside the supermarket when the man entered and fired several shots into the air, causing emergency services to swoop on the building.

Scroll down for video.

The attacker walked into the Mercadona shop, As Lagoas, before opening fire

He was reportedly carrying gasoline and gunpowder, and was later detained after a struggle ensued

Several smashed bottles can be seen strewn on the floor following the incident

According to police sources, the young man has psychological problems and is lives next-door to the shop.

The incident, which happened at around 2pm, did not result in any injuries but left many extremely shaken.

It was initially reported that one employee said that the gunman had shouted the Arabic phrase for 'God is great' before he began shooting. This was later denied by a spokesperson for the supermarket.

A double-barrelled shotgun can be seen in the image on the right. Witnesses told how they suddenly heard screams and shots before nearby officers screamed at them to get away

The incident, which happened at around 2pm, did not result in any injuries but left many extremely shaken

Police were able to detain the gunman after he ran out of ammunition, and later they emerged with a makeshift vest.

Witnesses told how they suddenly heard screams and shots before nearby officers screamed at them to get away.

According to Spanish media outlet La Region, police officer Carlos Perez, 38, revealed the gunman fired at him and he had to wait for backup.

He and his colleagues were able to detain him after he ran out of ammunition, and later they emerged with a makeshift vest.

Photos from after the incident show wine and broken glass strewn all over the shop floor.