PARIS -- Thousands of critics of a proposed security law that would restrict sharing images of police officers in France gathered across the country in protest Saturday, and officers in Paris who were advised to behave responsibly during the demonstrations fired tear gas to disperse rowdy protesters in the largely peaceful crowd.

Dozens of rallies took place against a provision of the law that would make it a crime to publish photos or video of on-duty police officers with the intent of harming their "physical or psychological integrity." Civil liberties groups and journalists are concerned that the measure will stymie press freedoms and allow police brutality to go undiscovered and unpunished.

In Paris, several thousand people packed the sprawling Republique plaza and surrounding streets carrying red union flags, French tricolour flags and homemade signs denouncing police violence, demanding media freedom or calling for Interior Minister Gerald Darmanin's resignation. Officers fired tear gas as scuffles broke out.

The crowd included journalists, journalism students, left-wing activists, migrants rights groups and citizens of varied political stripes expressing anger over what they perceive as a hardening police tactics in recent years, especially since France's yellow vest protest movement against economic hardship in 2018.

Many protesters, police and journalists have been injured during protests in recent years, including several Associated Press journalists.

"There were all those protests in the summer against police violence, and this law shows the government didn't hear us... It's the impunity. That's what makes us so angry," protest participant Kenza Berkane, 26, said.

Berkane, who is French and of North African origin, described being repeatedly stopped by police for identity checks in the metro or while going to school. while white friends were allowed to pass. "We ask ourselves when will this stop?"

The cause has gained renewed importance in recent days after footage emerged of French police officers beating up a Black man, triggering a nationwide outcry.

French President Emmanuel Macron spoke out against the video images on Friday, saying "they shame us."

Video that surfaced Thursday showed the beating, days earlier, of music producer Michel Zecler, following footage of the brutal police evacuation Tuesday of migrants in a Paris plaza. The officers involved in the beating of Zecler were suspended pending an internal police investigation.

An internal letter from Paris Police Prefect Didier Lallement called on officers to use "probity, the sense of honour and ethics" when policing the protests, which were authorized by authorities.

Hundreds of police in body armour, some with truncheons, others with tear gas launchers and a few with rifles, lined the march route and side streets. They erected tall metal gates barricading all main roads leading out of Bastille plaza at the end of the march route.

Through most of the march they hung back, chatting while holding their helmets or watching silently as protesters shouted "Shame!" at them.

The officers jumped swiftly to action after some objects apparently were thrown at them. The crowd was overwhelmingly peaceful, but some in the unruly minority came equipped with gas masks and helmets. An Associated Press reporter heard about 10 rounds of tear gas being fired and saw some small rocks and a couple of paving stones being thrown.

Article 24 of the proposed security law criminalizes the publishing of images of police officers with the intent of causing harm. Anyone found guilty could be sentenced to up to a year in jail, and fined 45,000 euros ($53,000).

While journalists have been the most outspoken over the security bill, it could have an even greater impact on the efforts of non-journalists who film police during aggressive arrests, notably minorities who can try to fight police abuse and discrimination with a few seconds of cellphone video.

Protesters calling for the article to be withdrawn say it goes against their democracy's "fundamental public freedoms."

Agathe Le Gall, a 26-year-old job seeker, said the proposal "is like the beginning of the end" because she fears laws will get tougher and tougher.

"All those videos we see online, we know that behind those incidents there are thousands more that aren't recorded," Agathe said Saturday. "I am lucky I am white because I am not targeted" by police.

Prime Minister Jean Castex announced Friday that he would appoint a commission to redraft Article 24, but he backtracked after hearing from angry lawmakers. The commission is now expected to make new proposals by early next year on the relationship between the media and police.