1 of 7
Andres Kudacki, Associated Press
A policeman communicates with a demonstrator by a cordoned off street, during a protest against Spanish Citizens Security Law in Madrid, Spain, Saturday, Dec. 20, 2014. Thousands of people have gathered in several Spanish cities to protest against a new law that sets hefty fines for offenses such as burning the national flag and holding demonstrations outside parliament buildings or strategic installations. Also can be fined protesters who prevent authorities from carrying out evictions, insulting a police officer and disseminating photographs of police officers that endanger them or police operations. The legislation also allows for the summary expulsion of migrants entering the country's North African enclaves illegally.

MADRID — Thousands of people protested in Spanish cities on Saturday against a proposed law that would set hefty fines for offenses such as burning the national flag and demonstrating outside parliament buildings or strategic installations.

The Public Security Law was approved by one house of parliament last week and is expected to be accepted by the other government-controlled one next month. The bill has been heavily criticized by opposition parties and human rights groups as an attempt by the conservative government to muzzle protests over its handling of Spain's financial crisis.

Saturday's largest demonstrations occurred in cities such as Barcelona, Bilbao and Madrid, while smaller ones took place in Almeria, Granada and Valencia. Some protesters wore tape covering their mouths and carried placards calling the measures a "gagging law."

The proposed law would allow fines of up to 30,000 euros ($37,000) for disseminating photographs of police officers that are deemed to endanger them or their operations.

Individuals participating in demonstrations outside parliament buildings or key installations would be fined up to 600,000 euros ($745,000), if they are considered to breach the peace. Those insulting police officers could be fined up 600 euros ($745). Burning a national flag could cost the perpetrator a maximum fine of 30,000 euros.

The protests — which saw demonstrators mingling with large crowds of Christmas shoppers in some cities — ended peacefully. Police in Madrid forced media photographers to produce identity papers.

The demonstrators included groups opposed to forced evictions because the bill would levy fines of 30,000 euros for attempting to prevent home repossessions.

Others protested an element of the legislation that would entitle police in Spain's North African enclaves of Ceuta and Melilla to summarily expel migrants caught trying to enter Europe by storming border fences.

(An earlier version of this story said the bill has already become law. It must first be approved by the Senate. )