Social media companies are undermining the safety of MPs by failing to properly tackle online abuse and should face legislation if they do not take action to protect democracy, parliamentary security chiefs have said.

House of Commons Deputy Speaker Lindsay Hoyle said MPs cannot allow democracy to be “destroyed” without companies like Facebook and Twitter “taking responsibility” for what appears on their platforms.

He was backed by Parliament’s director of security Eric Hepburn, who said social media companies are undermining the safety of parliamentarians by failing to react quickly or “sensibly” enough to reports of online abuse.

Their revelations come with social media firms under growing pressure to do more to police the proliferation of extremist and abusive material on the internet.

The pair said the problem of online abuse and the linked threat of physical violence towards MPs was getting worse.

Mr Hoyle, who chairs Parliament’s consultative panel on security, said when MPs speak on emotive debates in the Commons, such as badger culls or abortion, it often sparks death threats, other threats of violence or online abuse.

He said the situation “undermines democracy” and insisted MPs “can’t be silenced”.

Women MPs and in particular black and ethnic minority or Jewish female MPs suffer the worst abuse, Mr Hoyle added.

The Deputy Speaker and Mr Hepburn both urged social media companies to take more action as they were questioned by the Commons Home Affairs Committee.

Responding to questions from Tory MP Nusrat Ghani, Mr Hepburn said: “We certainly work very closely with the social media companies and we have flagged up to them, and we have advised members as well, to flag up to them content which they consider to be unacceptable and which should be taken down.

“We have had a number of cases where that has been the case.

“I think the question that you’re asking there is: do they react quick enough and do they react sensibly enough…? I think there’s a lot that they could do more actually on that.”

Asked by Ms Ghani if social media companies’ failure to act was undermining the safety of parliamentarians, Mr Hepburn replied: “I think that’s a conclusion that I could probably draw, yes.”

Mr Hoyle then interjected: “Of course it’s an attack on democracy and that’s the one thing we cannot accept, that’s why you’re doing the report and that’s why I welcome the report and that’s why we were so pleased to be able to give evidence today.

“And of course, yes, we have sat down with social media groups and the fact is that I genuinely believe that they’ve got a corporate responsibility, they’ve got to realise they cannot allow this to continue.”

He went on: “Actually we’re talking about the lives of people here and the future of democracy, we cannot allow it to be destroyed without them taking responsibility for what they allow to go on to their platforms.

“So the first thing is, and what I would say is, please, let’s work together to bring them into line and to get them into a sensible place.”

Mr Hoyle said if common sense does not prevail and social media firms fail to recognise their corporate responsibility, legislation may be needed.

“It’s about drawing the line in the right place, not what they believe is the right place, so whatever we do, if need be, if we have to put legislation through the House, so be it,” he said.

Jewish MP Luciana Berger has previously been subject to vile online anti-Semitic, including death threats, from far-right groups.

In February, Internet troll John Nimmo, 28, was jailed after sending anti-Semitic death threats to Berger, telling her she would “get it like Jo Cox”.

The perpetrator sent two emails to the Liverpool Wavertree MP, which included a picture of a large knife and telling her to “watch your back Jewish scum”.

The messages to the MP for Liverpool Wavertree came just three weeks after fellow MP Jo Cox was killed.

In December 2016, Joshua Bonehill-Paine, 24, posted five hate-filled blogs “of the worst kind” about MP Luciana Berger in support of a jailed far-right extremist. The “vile” troll who harassed a Berger in a string of anti-Jewish rants was handed the maximum two-year jail sentence to send a message “loud and clear” in the wake of the murder of fellow MP Jo Cox.