MI5 is using behavioural psychologists to investigate the mental health of Islamist extremists and identify those who might launch a terrorist attack.

The intelligence agency’s behavioural science unit is understood to be helping NHS staff and counterterrorism police understand the psychological triggers of terrorism.

Its specialists are also working with agents’ handlers and case officers to identity the “patterns of movements and behaviour of their subjects of interest to get a better understanding of their mental health vulnerability”, according to a Whitehall source.

Among those under scrutiny are jihadists who have returned from the battlefields of Syria and Iraq and may have post-traumatic stress disorder. Others are extremists unwilling to accept NHS support for conditions such as schizophrenia because of “cultural resistance”.

The disclosure follows