Article 487 [source]

Spanish Criminal Code
English translation

Anyone who deprives the King, the Queen or any of their ascendants or descendants, the Queen Consort or the Consort of the Queen, the Regent or any member of the Regency, or the Prince or Princess of Asturias, of their personal liberty shall be punished with a prison sentence of fifteen to twenty years, unless the acts are punished with a greater penalty in other provisions of this Code.