Article 47 [source]

Spanish Criminal Code
English translation

The imposition of the penalty of deprivation of the right to drive motor vehicles and mopeds will disqualify the convicted person from exercising both rights for the period specified in the sentence.

The imposition of the penalty of deprivation of the right to possess and carry firearms will disqualify the convicted person from exercising this right for the period specified in the sentence.

When the imposed penalty is for a period exceeding two years, it will result in the loss of validity of the permit or license that authorizes driving or the possession and carrying of firearms, respectively.