The attacker, who was reportedly carrying gasoline and gunpowder, walked into the Mercadona shop, 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.
Incident happened at around 2pm and did not result in any injuries but left many extremely shaken.
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.
One employee confirmed that the gun man had shouted the Arabic phrase for ‘God is great’ before he began shooting.
Witnesses told how they suddenly heard screams and shots before nearby officers screamed at them to get away.