MADRID — A puppet show at an open square in Madrid during Carnival festivities this month featured a policeman who tried to entrap a witch. The puppet officer held up a little sign to falsely accuse her, using a play on words that combined Al Qaeda and ETA, the Basque separatist group.

Angry parents complained, and the real police stepped in. They arrested two puppeteers, who could now face as much as seven years in prison on charges of glorifying terrorism and promoting hatred.

Paradoxically, the puppeteers say in their defense, the police proved their point: that Spain’s antiterrorism laws are being misapplied, used for witch hunts.

Far from an isolated episode, the arrests on Feb. 5 are part of a lengthening string of prosecutions, including two against a rap musician and a poet, that have fueled a debate over whether freedom of protest and speech are under threat in Spain and elsewhere in Europe because of fears of terrorism.