MADRID (Reuters) - Spain came under fire over freedom of expression on Tuesday, when the European Court of Human Rights rejected its conviction of two separatists for burning a photo of the former king, while Amnesty International said the country was “outlawing political satire.”

The ECHR ruled that Spain’s courts had breached the right to free expression of two pro-independence supporters from Catalonia when it convicted them for insulting the crown by burning a photo in 2007 of then-King Juan Carlos.

Separately, human rights group Amnesty issued a report saying a Spanish law aimed at banning the “glorification of terrorism” was being used as part of a sustained attack on the freedom of expression.

The law has led to the arrest of rap musicians, film makers, social media users and even two puppeteers among others.

“Rapping is not a crime, tweeting a joke is not terrorism and holding a puppet show should not land you in jail,” the author of the report, Eda Seyhan, said.

A spokeswoman for the High Court and Supreme Court declined to comment. Officials at Spain’s Justice Ministry were not immediately available to comment.

Spain’s 1995 anti-terrorism law, which was expanded in 2015 after attacks by Islamist extremists in Paris to include social media, aims to stem public comments that could be construed as glorifying terrorism or humiliating victims of political violence.

According to Amnesty, the number of people arrested under the law rose to 39 in 2017 from three in 2011. Spain’s courts did not immediately respond to a request to confirm the number of detentions.

The arrests include a student who was detained last year after tweeting a joke about the assassination of Prime Minister Luis Carrero Blanco by the Basque separatist group ETA in 1973 and two puppeteers arrested in 2016 for including a sign in their show poking fun at the armed group.

The student received a suspended sentence, while the puppeteers spent five days in jail.

Other detentions include 12 rappers from the collective La Insurgencia who last December faced sentences of more than two years each and bans from working in the public sector, a clause commonly added in such rulings, for lyrics seen glorifying the defunct armed anti-fascist group Grapo.

The ECHR ruled that the conviction of the two pro-independence supporters under a separate law, which resulted in the pair each paying a 2,700 euro ($3,330) fine to avoid a 15-month prison sentence, breached their right to freedom of expression.

It said the gesture did not constitute either an incitement to hate or an attack on the king’s person and ordered Spain to pay back the fines and 9,000 euros to cover costs and expenses.