Spain's senate is set to approve a tough new security law Thursday that includes stiff fines for people who take part in violent anti-austerity protests. Critics slam the package as a blatant attack on free assembly and expression. The measures come three years after Spaniards defied authorities with rallies that spiraled into violence, with demonstrators fighting police in rage against austerity measures and in solidarity with those facing eviction.

Media advocates are concerned that the government's Public Security Law, expected to be finalized later in the country's lower house, could stifle journalists because of a clause authorizing fines for "unauthorized use of images" of police.

The bill pressed by Prime Minister Mariano Rajoy's Popular Party has been dubbed the "Gag Law" by critics, including a panel of U.N. experts. But it is virtually guaranteed passage, because Rajoy's party has a majority in both houses of Parliament.

Here's a look at the law and what's at stake:

___

BIG FINES FOR UNAUTHORIZED PROTESTS

Rajoy's administration was enraged in 2012 when tens of thousands of protesters surrounded Parliament in downtown Madrid to rail against tax hikes and government cutbacks.

Spaniards must seek government permission to hold protests, but the movement to "encircle" Parliament was unauthorized — and protesters ended up clashing with police. Images of the violence in the heart of the capital shot around the world, spooking investors already concerned about Spain's stability.

The bill sets fines of up to 30,000 euros ($33,000) for protests near Parliament and Spain's regional lawmaking buildings when there is a "serious disturbance of public safety." That means protesters even if they don't participate in violence could face fines.

Human Rights Watch said the "measure is intended to discourage protests that target national and regional legislative bodies" and urged the government to find ways for protesters to express themselves near the sites.

A whopping fine of 600,000 euros ($638,000) is included for unauthorized protests near key infrastructure — including transportation hubs, nuclear power plants, refineries and telecommunications installations.

Spanish government records show riot police intervened in only 1 percent of the thousands of demonstrations during the height of the country's economic crisis in 2012 and 2013, prompting opponents to say the law is disproportionate and unnecessary.

___

EVICTION DEMONSTRATIONS

Spain's most emotional protests often happen when demonstrators try to halt court-ordered forced evictions of families who cannot pay their mortgages. These people end up not only homeless but still obliged to pay back lenders.

Nearly 35,000 primary residence evictions were carried out last year, a 7 percent rise from 2013. And 11 people were arrested last month after allegedly throwing gasoline at police during a Madrid eviction. Protesters also clambered onto heavy equipment brought in to demolish part of the home; they were dragged away by riot police.

The bill doesn't mention evictions by name, but specifies fines of up to 30,000 euros for preventing government employees from enforcing administrative or judicial orders, even if protesters don't commit a crime.

"This provision appears tailor-made to suppress organized gatherings to prevent evictions for mortgage default and rent arrears," Human Rights Watch said.

___

RESTRICTIONS ON IMAGES OF WORKING POLICE

Spain's government says beaming pictures of police cracking down on protests could prevent them from doing their jobs or put them at risk of reprisals.

People could face fines of up to 30,000 euros when they disseminate images of officers "that would endanger their safety or that of protected areas or put at risk the success of a (police) operation," the bill says.

Unions representing journalists and Human Rights Watch are worried that the prospect of fines will cause journalists to self-censor their work at protests.

The impact of the possible fines on journalists probably won't be clear until authorities impose them, and the journalists appeal. At that point, courts will have to determine whether disclosure of the images is protected under freedom of information laws, or if the dissemination hurt national security or the safety or privacy of individual officers, said Alejandro Tourino, a Madrid-based media lawyer with the Ecija firm who has done work for The Associated Press.

___

EXPULSIONS FOR FENCE-STORMING MIGRANTS

Every week last year, hundreds of mostly sub-Saharan African men stormed towering, barbed-wire fences that separate Spain's North African enclave of Melilla from Morocco. The migrants live in rudimentary camps on a nearby mountain before staging well-organized, pre-dawn attacks on the fences.

At least 2,100 made it across in 70 attempts, but many more were intercepted by Spanish and Moroccan police amid accusations by activists that they were expelled even though they touched Spanish soil and should have been allowed to stay and seek asylum.

The original bill sought to legalize summary expulsions. It was amended to set up a process for asylum seekers to have their cases considered if they enter Spain via official Moroccan checkpoints — not over fences.

Critics of the bill say the amendment was a positive step, but they still fear asylum seekers may continue to climb the fences and face expulsion if they can't get through official checkpoints.

___

THE GOVERNMENT'S TAKE

Rajoy's administration insists the bill was crafted mainly to update a 23-year-old law drafted when the opposition Socialist Party was in power. The government says it will provide more effective security by rooting out protesters prone to violence.

It also allows fines for sex workers if they seek clients near areas where children are present and for drug users who consume in public.

The Socialist Party has vowed to repeal the law if it wins future elections.

But Interior Minister Jorge Fernandez Diaz has said the bill provides a balance between security and citizens' rights by setting fines and sanctions for offenses that are otherwise unpunishable.

"It's a law for the 21st century," Fernandez Diaz told law enforcement officials. "It provides better guarantees for people's security and more judicial security for people's rights."

___

Associated Press writer Ciaran Giles in Madrid contributed to this story.