Article 417 [source]

Spanish Criminal Code
English translation

1. Any public official or authority who discloses secrets or information acquired by reason of their office or position, and which should not be divulged, shall be subject to a fine of twelve to eighteen months and special disqualification from public employment or office for a period of one to three years.

If the disclosure referred to in the preceding paragraph results in serious harm to the public interest or to a third party, the penalty shall be imprisonment for one to three years and special disqualification from public employment or office for a period of three to five years.

2. If the secrets belong to a private individual, the penalties shall be imprisonment for two to four years, a fine of twelve to eighteen months, and suspension from public employment or office for a period of one to three years.