Article 586 [source]

Spanish Criminal Code
English translation

Any foreigner residing in Spain who commits any of the crimes included in this chapter shall be punished with a penalty one degree lower than that prescribed for them, except as provided by Treaties or by the Law of Nations concerning diplomatic, consular and international organization officials.