The French government was accused by right and leftwing opponents of trying to create a form of “thought police” and institute censorship, as parliament began debating Emmanuel Macron’s proposed law to ban fake news on the internet during election campaigns.

The draft law — designed to stop what the government calls “manipulation of information” in the runup to elections — would allow political parties to complain about widely spread assertions deemed to be false or “implausible” and a French judge could immediately move to stop their publication.

The centrist President Macron, who beat the far-right candidate, Marine Le Pen, in 2017, has personally backed the reform after he complained his presidential campaign was targeted by online fake news rumours, including that he was gay and that he had a secret bank account in the Bahamas. He has said a law was needed against the spread of fake news “in order to protect democracy”.

The government wants the law to come into force before next spring’s European parliament elections. It is likely to pass because Macron has a parliamentary majority.

But in heated exchanges in parliament on Thursday, members of the rightwing Les Républicains party accused Macron of trying to create a “thought police” that threatened freedom of expression. The leftwing France Insoumise party warned of a new kind of censorship and cautioned against a hasty, unnecessary and ineffective law against an ill-defined concept of fake news.

The culture secretary, Françoise Nyssen, told parliament the spread of fake information online was “polluting” the public domain and amounted to a “slow poison that destroys our credibility”.

After one journalists’ union had warned the law could be used to hamper reporters’ work, Nyssen said that professional media would not be targeted.

Bruno Studer, a politician from Macron’s La République En Marche party, who drafted the bill, said the law would focus on “manipulation of information” and deliberately not use the English term “fake news”. He said the government wanted to distance itself from any ideological appropriation of the term “fake news” as used by the US president Donald Trump as means to attack journalists and the media.

The law aims to identify and stop deliberately false information that is “massively” spread online in the three-month period before an election.

Most criticism has been focused on the section of the law that allows political parties or candidates to complain about an item of allegedly false or implausible information online and a judge will, within 48 hours, rule on it and can block the publication. The judge must decide whether the allegedly false information could determine the course of an election, and whether it has been massively and artificially spread online.

Social networks would also have to clearly state who was sponsoring content. The law would also give the French media regulator new powers to remove broadcasters’ rights to air content in France if it is deemed to be deliberately fake or implausible. Foreign broadcasters could be taken off air if they were deemed to be attempting to destabilise France, a measure taken to be aimed at Russian state-backed outlets.

The newspaper Le Monde warned of the importance of ensuring the law could not one day be used by an authoritarian government for censorship. The paper argued that the real problem was that people readily believed fake news — a sign of “a major crisis in our democracies, people’s growing mistrust towards their institutions”.

Constance Le Grip of Les Républicains told parliament the law was “useless, redundant, inadequate, dangerous, an attack on freedom of expression, badly written and only raises concerns instead of bringing solutions”.

During the election campaign in spring 2017, Macron filed a legal complaint after Le Pen, the Front National leader, referred to stories about him placing funds in an offshore account in the Bahamas. At the time, Macron’s political movement, En Marche, called Le Pen’s statements a “textbook case” of fake news.

Macron has also had harsh words for Moscow, accusing Russia of following a “hybrid strategy combining military intimidation and an information war”.