The terror threat from Islamic State is "here to stay", the head of MI5 has warned.
Andrew Parker described the danger posed by the group as "at least a generational challenge".
He issued the stark assessment as MI5 revealed 12 plots have been foiled in the UK since June 2013.
The official threat level for international terrorism in the UK currently stands at severe - meaning an attack is "highly likely".
It has been at the category for more than two years amid the emergence of IS - also known as Isil - and security services are on high alert following a number of assaults abroad.
MI5 Director General Mr Parker said: "Isil is an enduring threat, here to stay, and is at least a generational challenge.
"MI5 and the intelligence agencies have good defences because of the investment made in our capabilities.
"We will find and stop most attempts to attack us, but not all."
MI5 - officially known as the Security Service - is also continuing to work to counter threats from terrorism in Northern Ireland and the activities of hostile states seeking to carry out damaging espionage.
Mr Parker's comments came after an address to the Royal Society's annual diversity conference.
He called on the country's scientific and technological sector to continue to play its crucial part in keeping the country safe.
The spy chief said all MI5's successes had relied on the innovation, talent and expertise of staff in IT, science and technological roles - and that these skills were increasingly needed in countering the threats the UK faces.
He added: "MI5 has a vital, critical dependence on the best and brightest minds to help us stop these threats.
"Scientists, technologists, engineers and mathematicians play a crucial part in keeping the country safe.
"I pay tribute to their work and I call upon others in these disciplines to consider the varied and challenging roles a career in British intelligence can offer."
Mr Parker discussed the need for a diverse and inclusive workforce to make MI5 more successful in its mission to keep the country safe.
He said: "My experience is that for all the challenges MI5 faces, we are stronger and better placed to rise to them with the richest mix of talents we can find.
"It's what makes it less likely people will be killed by terrorism or our secrets will be stolen from under our noses."
Last week a senior counter-terrorism police officer described how authorities were working at a "relentless pace", dealing with around 550 live cases at any one time.
It was revealed earlier this year that around 850 people linked to the UK and regarded as a security threat are believed to have taken part in the Syrian conflict, with just under half thought to have returned to this country.