A Scottish man defecated inside a police van and threatened to blow up the local station while claiming to be a notorious executioner during a Valium and whisky bender.

John Simpson, 25, told officers "they don't call me Jihadi John for nothing – I've been done for terrorism" as officers tried to coax him out of the vehicle cage, which he had smeared with his own faeces during an eventful journey back to Dundee Police headquarters.

When his defence lawyer later talked him through the night's events, Simpson couldn't remember what he had done.

He was initially arrested on 28 September after being seen lurking around his ex-girlfriend's house in possession of two knives, the Dundee Evening Telegraph reported.

"He was taken to Dundee police HQ and whilst en route he defecated and smeared it inside the van," Charmaine Gilmartin, prosecuting, said.

"Thereafter he stated 'I'm going to blow up Bell Street [Dundee's police HQ], they don't call me Jihadi John for nothing, I've been done for terrorism'.

"He thereafter threatened to throw faeces over whoever opened the van door. Police Operational Support Unit specialist officers attended and he was shortly thereafter removed from the van.

"Whilst at the charge bar he acted aggressively and said he would shoot the OSU officers and threatened their families," she added.

Simpson pleaded guilty to possessing knives and behaving in a threatening and abusive manner on the journey back to the police station.

Defending, Scott Norie said: "He has an extremely poor record for such a young man. He had drunk a lot of whisky and taken Valium and his memory is pretty much non existent. When I went over the statements from police with him he was astounded at what he had done."

Sheriff Alastair Carmichael jailed Simpson for 18 months, which he will serve at HMP Perth. The judge said: "Police doing their duty to protect the public were faced by you threatening to smear them with your own excrement and threatening to shoot them.

"You threatened further violence to them and their families. It goes way beyond the type of behaviour police should have to endure from people in their custody."