If you are the owner, you must show:
EU resident or in transit
Foreign national from outside the EU
Form 790 (payment of fees) completed and paid (one per passenger). The fee can be paid online and at cash machines and banks included in the AEAT agreements.
These procedures can be carried out remotely at Adolfo Suárez Madrid-Barajas, Bilbao, Josep Tarradellas Barcelona-El Prat and Málaga-Costa del Sol airports: https://sede.guardiacivil.gob.es/procedures/choose-ambit/idp/731
Inquire at the country’s embassy or consulate in Spain about current local legislation on the possession, transportation and use of firearms.