France's constitutional council rejected on Thursday a controversial provision of the country's "global security" law which made it an offence to maliciously share images that identify operating police officers.
The new legislation had sparked widespread protests throughout the country. It also drew criticism from human rights group and journalists, who feared it would curtail press freedom and lead to less police accountability.
The rallies prompted the French government to announce a "complete new rewrite" of the contested article, which had originally been approved by the country's Senate.
The overhauled Article 24 said it was an offence to disseminate images of national police officers or gendarmes if there was intention or "provocation" to identify them.
The offence was punishable by up to five years in prison and a €75,000 fine.
In its decision, the constitutional council said the legislator had not sufficiently defined the elements constituting the offence and therefore "disregarded the principle of the legality of offences and penalties".
Reacting to the decision on Twitter, Interior Minister Gerald Darmanin said he would make proposals to the prime minister to "improve" the provisions that were rejected by the constitutional council.
Police unions, which supported the reform, regretted the rejection of the provision.
"The rejection of article 24 shows that France is stagnating on the rights of some humans and continues to deprive police officer of the right to protect their identity," tweeted Linda Kebbab of Unité SGP Police FO union.