Sexual predators could be prevented from carrying out attacks with a brain implant which detects a ‘moment of weakness’ then zaps them with electricity before they can act on their harmful impulses.

Scientists at Stanford University have discovered that the brain sends out a distinct signal in the seconds before a burst of impulsive behaviour.

The electrical activity occurs in an area of the brain called the nucleus accumbens, the reward centre which reinforces survival-promoting actions like obtaining food or sex, by flooding the body with anticipatory pleasure.

That pleasure can be so intensive that it often overrides concerns about social consequences. But now scientists have discovered what the signal looks like and how it can be switched off.

The researchers showed that supplying a small electrical pulse to the nucleus accumbens as soon as the electrical signal occurs, prevents the impulsive behaviour.

The method could combat obesity, substance-abuse disorders, pathological gambling, sexual addiction or intermittent explosive disorder, a psychiatric condition marked by impromptu outbursts of inappropriate anger