(Bloomberg) -- U.K. Prime Minister Boris Johnson is creating protections for political speech as part of legislation which will give Britain sweeping legal powers to regulate content online.

The biggest web platforms like Facebook Inc. and Twitter Inc. will be “forbidden from discriminating against particular political viewpoints and will need to apply protections equally to a range of political opinions, no matter their affiliation,” the Department for Digital, Culture, Media and Sport said in a statement on Wednesday describing the draft Online Safety Bill.

The bill also asks U.K. regulator Ofcom to set out how companies should guard “freedom of expression,” such as giving ways to appeal if content is removed. It raises major questions about online debate and will now be scrutinized by lawmakers before being brought to a vote in Parliament.

The largest social media platforms have found themselves in a fiery clash about the nature of the digital public square, and their responsibilities as the private businesses that host it. That’s been exemplified in Twitter and Facebook’s decisions to ban former President Donald Trump for breaking their rules around glorifying violence.

‘Duty of Care’

The sweeping legislation was first proposed more than two years ago, and has expanded beyond an initial focus on protecting young people online. It also adds measures to tackle online fraud.

It will impose a “duty of care” on businesses, the U.K. said in a statement. Because it will apply to hundreds of millions of user-generated posts, companies will be expected to protect users against illegal content on their own platforms. Then Ofcom will be responsible for auditing and enforcing these policies, with potential fines for non-compliance as much as 10% of annual global revenue.

Ministers added measures to the bill to ensure “necessary online protections do not lead to unnecessary censorship,” said the statement.

The biggest companies will also need to curb content which is lawful but still deemed harmful, such as posts encouraging self-harm. A criminal liability for senior web company managers will be a “deferred power” which ministers can bring in later if they deem it necessary.

“We support regulation that is forward thinking, understanding that a one-size-fits all approach fails to consider the diversity of our online environment,” a Twitter spokesman said in a statement, adding that the company looks forward to reviewing the bill. “We will continue to collaborate with the government and industry to build on the work we’ve already undertaken to make the internet a safe environment for all.”

©2021 Bloomberg L.P.