Article 407 [source]

Spanish Criminal Code
English translation

1. Any public official who abandons their post with the purpose of failing to prevent or prosecute any of the crimes included in Titles XXI, XXII, XXIII, and XXIV shall be punished with imprisonment for one to four years and absolute disqualification from holding public office or employment for a period of six to ten years. If the abandonment was carried out with the purpose of failing to prevent or prosecute any other crime, the penalty shall be special disqualification from holding public office or employment for a period of one to three years.

2. The same penalties shall be imposed, respectively, when the abandonment is intended to avoid carrying out the sentences for these crimes imposed by the competent judicial authority.