Article 24 [source]

Spanish Criminal Code
English translation

1. For criminal purposes, anyone who, individually or as a member of a corporation, court, or collegial body, holds command or exercises jurisdiction shall be considered an authority. In any case, members of the Congress of Deputies, the Senate, the Legislative Assemblies of the Autonomous Communities, and the European Parliament shall be considered authorities. Officials of the Public Prosecutor's Office and Prosecutors of the European Public Prosecutor's Office shall also be considered authorities.

2. Anyone who, by direct provision of law, election, or appointment by a competent authority, participates in the exercise of public functions shall be considered a public official.