Spain’s lower house of parliament approved legislation on Thursday that allows for the summary expulsion of migrants entering the country’s north African enclaves illegally and hefty fines for protests outside parliament buildings or strategic installations.

The Public Security Law, approved in a 181-141 vote, entitles police in Spain’s north African city enclaves of Ceuta and Melilla to hand migrants caught trying to storm border fences back to Moroccan police on the other side of the border.

The law has been heavily criticised by opposition parties and rights groups as an attempt by the conservative government to muzzle protests over its handling of the economic crisis.

The measures, which update a 1992 law, also include fines of up to 30,000 euros (£23,650) for disseminating photographs of police officers that endanger them or police operations.

Spanish cities have been the scene of weekly protests, which are mostly peaceful, since the onset of the crisis in 2008.

The bill was passed easily because the conservative Popular party has an absolute majority. Opposition parties have pledged to scrap it if elected to office.

The Popular party, headed by Prime Minister Mariano Rajoy, took office in 2011 and issued a series of austerity measures and cutbacks in health and education. The measures triggered an increase in street protests, including several attempts to encircle parliament, some of which ended up in clashes with police.

The new legislations says organisers of demonstrations outside parliament buildings and key installations that are deemed to be disturbing the peace can be fined up to 600,000 euros. Protesters who prevent authorities from carrying out evictions can be fined up to 30,000 euros while insulting a police officer can earn offenders fines of up to 600 euros.