MADRID — The European Court of Human Rights has sided with two Spaniards who set fire in public to a photograph of Spain’s king and queen, saying their protest amounted to freedom of expression.

The Strasbourg, France-based court ruled Tuesday that the 2007 protest by Enric Taulats and Jaume Capellera during the king’s visit to Girona, in northeast Spain, was political, not personal, and involved a “permissible degree of provocation” to convey its message.

They were initially sentenced in Spain to 15 months in prison for insulting the Crown, though that was later reduced to a fine.

The pair took their case to the European court after losing appeals in Spain against the conviction. The Spanish constitutional Court ruled their acts incited hatred and violence against the monarchy.