Britain's Prime Minister Theresa May speaks at a campaign event in North Tyneside, Britain May 12, 2017. REUTERS/Scott Heppell

LONDON (Reuters) - British Prime Minister Theresa May pledged to create new powers allowing her to punish social media and communications companies that fail to look after users’ data, and to demand cash from firms to pay for policing the internet.

The election pledge comes after firms like Facebook and Twitter have been criticized the government for not doing enough to stop the spread of extremist content online or help victims of abuse.

May, who is expected to win a majority at the June 8 election, pledged to pass laws giving users new rights to access data held about them, and granting the government the power to enforce them with sanctions.

“The internet has brought a wealth of opportunity but also significant new risks which have evolved faster than society’s response to them,” May said in a statement.

“We want social media companies to do more to help redress the balance and will take action to make sure they do.”

Hospitals and doctors’ surgeries across England were forced to turn away patients and cancel appointments on Friday after a nationwide ‘ransomware’ cyber attack crippled some computer systems in the state-run health service.

The Conservative Party said it wanted to be able to tax the industry if it chooses to, citing similar plans already in force for the gambling industry.

“The Conservatives will also create a power in law for government to introduce an industry-wide levy from social media companies and communication service providers to support awareness and preventative activity to counter internet harms,” the party said in a statement.