LONDON (Reuters) - Britain faces the most acute threat ever from Islamist militants seeking to inflict mass attacks, often with spontaneous plots that take just days to bring to execution, the head of the MI5 domestic intelligence agency said on Tuesday.

Director General of MI5 Andrew Parker delivers a speech in central London, on the security threat facing Britain October 17, 2017. REUTERS/Stefan Rousseau/Pool

After four militant attacks this year that killed 36 people in Britain - the deadliest spate since the London “7/7” bombings of July 2005, MI5 chief Andrew Parker said the threat was at the highest tempo he had seen in 34 years of espionage.

“The threat is more diverse than I have ever known: plots developed here in the UK, but plots directed from overseas as well, plots online, complex scheming and also crude stabbings, lengthy planning but also spontaneous attacks,” said Parker.

“Attacks can sometimes accelerate from inception, through planning, to action in just a handful of days,” he said in a speech in central London. The director general of MI5 rarely gives public speeches. The last was in 2015.

Islamic State militants in Syria and Iraq have been in retreat for two years: They lost their de facto capital in Syria, Raqqa, on Tuesday and have been forced back into an ever-diminishing foothold along the Euphrates river valley.

But as their territory, wealth and swagger decline, the militants have intensified online propaganda which has helped radicalise and inspire extremists to attack civilians in the name of Islam across Europe, the Middle East and Africa.

Parker said there had not yet been a large influx of British militants returning home from Syria and Iraq.

“MORE THREAT, FASTER”

Britain has foiled 20 plots in the past four years, with seven Islamist attacks prevented in the past seven months, Parker said. He said there were 500 live operations involving 3,000 people involved in militant activity.

MI5, established in 1909 to counter German espionage ahead of World War One, is tasked with protecting British national security and so takes the lead, along with the police, in countering militant attacks.

But after a suicide bomber killed 22 people at a pop concert by U.S. singer Ariana Grande in Manchester, MI5 began a review of how it handled intelligence on the bomber, Salman Abedi, who was known to the intelligence agencies.

Abedi was not among the 3,000 people currently under active investigation by MI5, although he was one of around 20,000 people known to have some connection to extremism.

“When an attack happens, we are determined, using the harsh light of hindsight, to squeeze out every last drop of learning,” Parker said. “We are constantly evolving to stay ahead.”

MI5, which employs around 4,000 people, says it does not have the resources to monitor every suspicious person. It works alongside the Secret Intelligence Service, or MI6, which operates abroad, and GCHQ, Britain’s eavesdropping agency.

“NOT KING CANUTE”

Britain has repeatedly demanded that Silicon Valley companies do more to suppress extremist content and allow access to online communication.

After British militants rammed a van into pedestrians on London Bridge and went on the rampage through packed bars, stabbing revellers in June, Prime Minister Theresa May said Britain must be tougher on stamping out Islamist militancy and proposed regulating cyberspace.

Parker said militants’ abuse of the internet could slow down the rapid pace of the hunt for attackers.

“This pace together with the way in which extremists can exploit safe spaces online can make threats harder to detect and give us a smaller window to intervene.”

Britain’s interior minister, Amber Rudd, said earlier this month that WhatsApp’s end-to-end encryption communication services allowed paedophiles and organised crime groups to operate beyond the reach of the law.

But Parker refrained from naming any companies directly and called for a nuanced partnership to tackle militants and serious crimes such as child abuse.

“I am not somehow King Canute trying to hold back the tide of developing technology and wouldn’t wish to be heard that way,” he said. “Technology is not the enemy, indeed it holds many opportunities for us.”

When asked directly whether Google, Facebook and Amazon were doing enough to prevent communications among militants, he said: “There is a reasonable expectation, I think, from all of us but also from the public at large that these companies would do what they can to help us deal with these worst excesses.”