MADRID -- A Spanish court on Wednesday released two puppeteers jailed since last week for allegedly praising terrorism in a controversial Carnival show funded with public money.

The decision came after prosecutors recommended setting them free but ordering them to hand in their passports and report to the court daily while the investigation continues.

The puppeteers were detained without bail last Friday for using a sign during their performance saying, "Long Live Alka ETA," a word-play reference to Spain's armed Basque group ETA and al Qaeda. Praising terrorism has been a crime in Spain since 1995.

Get Breaking News Delivered to Your Inbox

The satirical theater piece, funded by Madrid's city government, also featured the hanging of a judge's effigy and police beatings, prompting parents attending with children to complain.

Spain's caretaker national government run by the conservative Popular Party backed the arrests but critics including some opposition politicians said it was an attack on freedom of speech.

The prosecutor's office initially backed the no bail-decision, citing a risk the puppeteers might try to flee or repeat the alleged offense. But it said Wednesday that taking the passports and confiscating their show material reduced the risk.

The puppeteers were released late Wednesday afternoon from a jail on the outskirts of Madrid and declined to speak with reporters.

Madrid Mayor Manuela Carmena apologized Monday to parents whose children saw the puppet show, but criticized the puppeteers' jailing as disproportionate.

She launched an investigation into why city officials were unaware of the show's content and mistakenly advertised it as suitable for all ages. The show was commissioned as part of Carnival celebrations.