French lawmakers approved a controversial law on Wednesday aimed at preventing hate speech on social media, a measure that critics considered a form of censorship.

The law compels social media platforms and search engines to remove any content that incites hatred, violence, racism or religious intolerance within 24 hours, or a fine of up to 1.25 million euros.

The law was voted on in the National Assembly, where right-wing parties opposed it, while the Socialists abstained.

The bill on hate speech was passed in February in the Senate, with some members of the assembly expressing their opposition to the 24-hour clause to remove offensive content.

The law - which was brought up before Parliament more than a year ago - is an extension of Macron's pledge to fight racism and anti-Semitism, and has been subject to many amendments in response to criticism, including a call by the European Commission for a clearer definition of the content to be criminalized.

Because of the law, human rights and watchdog organizations in France are concerned about possible breaches of the individual's right to express himself on the World Wide Web.