Article 525 [source]

Spanish Criminal Code
English translation

1. Those who, with the intent to offend the feelings of the members of a religious denomination, publicly ridicule its dogmas, beliefs, rites, or ceremonies, whether verbally, in writing, or through any type of document, or who publicly insult those who profess or practice them, shall be subject to a fine of eight to twelve months.

2. The same penalties shall apply to those who publicly ridicule, verbally or in writing, those who do not profess any religion or belief.