Hasél – real name Pablo Rivadullo – was handed the sentence on Tuesday after a court heard how he had used YouTube to share songs in which he stated his wish that someone would commit a terrorist attack on members of Spain's ruling Popular Party (PP) and opposition Socialist Party (PSOE).
He also used his rhymes to describe Manuel Pérez Martínez – better known as 'Camarada Arenas' – as a "hero".
Pérez was the leader of GRAPO, a terrorist armed wing of the Communist Party.
Spanish daily Hoy.es reported that his lyrics included lines such as "My brother went into the PP headquarters shouting 'Up with ETA!' Don't tell me the tale of who the bad guys are, I only think about killing them."
The rapper said of the Socialist Party (PSOE): "Look at the PSOE pigs feeding off the monarchy. I'd shoot them one at a time; it would be right; something would improve."
In the trial his lawyer defended the rapper as having merely "used his right to freedom of expression and creation as an artist", adding that "no one has the right to change his ideas."
But the magistrates in charge of the case stated that "the discourse of hatred is not sheltered by freedom of expression in a democratic state."
The sentence cited a ruling by Spain's Supreme Court which declares that the crime of 'glorifying terrorism' requires "that the expressions or statements which are formulated mean, from a semantic or literal point of view, the glorification or justification of terrorism or its perpetrators."
It added: "This is what happens in each and every one of the lyrics of the accused's songs, going beyond the limits of freedom of expression in a way that this key right cannot cover."