Aforamiento - Fuero de Corte
Shortly before he abdicated, an organic law was enacted granting aforamiento to the king who has abdicated (King Juan Carlos) and his consort (Queen Sofía), the new queen consort (in this case Queen Letizia), and the princess of Asturias (Princess Leonor). Aforamiento means allowing a person to be tried in a higher court than the person would be tried in if he or she were an ordinary citizen. People granted this right to be tried in a higher court (in this case, the Spanish Supreme Court) are called aforados. Apparently Juan Carlos had hoped that this right to be tried in the Supreme Court would protect him from lawsuits like this one, but in this case, it has not.
The term used in some Latin American countries is fuero de corte. Thus, for example, Art. 186 of the Código Orgánico de la Función Judicial in Ecuador provides that "Se hallan sujetos a fuero de Corte Nacional en materia penal únicamente las autoridades, funcionarias y funcionarios que señalen la Constitución y la ley". Note that "Corte Nacional" is the new name of Ecuador's Supreme Court, which was formerly called the "Corte Suprema."