Spain's Supreme Court has sentenced a rapper musician to a year in prison for exalting terrorism and humiliating terrorism victims in Twitter messages.

In the tweets posted between 2013 and 2014, Cesar Montana Lehmann, 52, of the Def Con Dos rock band, talked of sending a cake bomb to former King Juan Carlos on his birthday. He also said some politicians made him long for a former leftist armed group.

Montana was also banned from holding public office for 6½ years.

Amnesty International last week cited Montana's case as an example of the excesses being committed in Europe under anti-terror laws.

The sentence Thursday followed an appeal by prosecutors of Montana's acquittal by a lower court last year.