Google, Facebook and other internet companies could be prosecuted if they do not stop extremist videos from being seen on their websites by people in Britain, The Daily Telegraph can disclose.

Ministers are considering a new law which would mean Google – which owns YouTube - and other social media sites like Facebook and Twitter can be prosecuted if they allow such videos to be disseminated.

Theresa May, the Prime Minister, made clear her displeasure at internet companies that publish extremist content on Friday, saying “the ball is in their court” over taking action.

Google publicly apologised this week after the growing scandal over extremist videos on YouTube led to a series of companies pulling their adverts from the internet giant.

Google, which owns the video sharing website YouTube, and other social media sites have an agreement to take down extremist content within 24 hours when they are alerted to it.

But ministers are worried that this still allows the videos to be viewed thousands of times before they are taken down.