The prime minister has repeatedly called for an end to the “safe spaces” she says terrorists enjoy online.

Ministers have called for limits to end-to-end encryption, which stops messages being read by third parties if they are intercepted, and measures to curb the spread of material on social media.

On Wednesday, the prime minister will hail progress made by tech companies since the establishment in June of an industry forum to counter terrorism.

But she will urge them to go “further and faster” in developing artificial intelligence solutions to automatically reduce the period in which terror propaganda remains available, and eventually prevent it appearing at all.

The UK, France and Italy are to call for a target of one to two hours to take down terrorist content wherever it appears.

‘Best brains in the world’

Internet companies will be given a month to show they are taking the problem seriously, with ministers at a G7 meeting on 20 October due to decide whether enough progress has been made.

A Downing Street source said: “These companies have some of the best brains in the world.

data-ad-format="auto">

“They should really be focusing on what matters, which is stopping the spread of terrorism and violence.”

Technology companies defended their handling of extremist content after criticism from ministers following the London Bridge terror attack in June.

Google said it had already spent hundreds of millions of pounds on tackling the problem.

Facebook and Twitter said they were working hard to rid their networks of terrorist activity and support.

YouTube told the BBC that it received 200,000 reports of inappropriate content a day, but managed to review 98% of them within 24 hours.

Addressing the UN General Assembly, Mrs May will say terrorists will never win, but that “defiance alone is not enough”.

“Ultimately it is not just the terrorists themselves who we need to defeat. It is the extremist ideologies that fuel them. It is the ideologies that preach hatred, sow division and undermine our common humanity,” she will say.

‘Mystified’

Mrs May’s appearance at the UN comes days before she is due to give a major speech on Brexit – a subject that led to repeated questions from journalists on her visit.

Foreign Secretary Boris Johnson was accused of undermining her plans by writing a 4,000-word newspaper article setting out his own vision for Brexit.

Speaking to the Guardian, Mr Johnson said he was “mystified” by the row his article had prompted, saying he had “contributed a small article to the pages of the Telegraph” because critics had been saying he was not speaking up about Brexit.