A MAN posing as a secret agent roamed Bradford showing off a realistic handgun hidden under his jacket, a court heard.

Mohammed Ali displayed the black imitation firearm in a holster to two schoolgirls, his doctor and a court officer serving him with an injunction.

Depressed Ali, 50, of Sunbridge Road, Bradford, later told the police he hoped an armed response unit would be despatched to end his life.

Two months after committing the offences, on June 22, 2009, Ali left the country on a plane to Dubai and stayed in South East Asia until the end of last year, prosecutor James Weekes told Bradford Crown Court.

Yesterday, Ali was sentenced to a 12 month community order, with probation service supervision, for what the Recorder of Bradford, Judge Roger Thomas QC, said was a bizarre and sorry case.

Ali pleaded guilty to three charges of possession of a black air pistol with intent to cause fear of violence.

Mr Weekes said the defendant bought the gun on the internet when he was suffering from depression after the break-up of a relationship.

Three days before showing it to the girls, aged 14 and 15, he told the receptionist at his doctor's surgery: "Do you know I'm armed at the moment?"

The police were called but Ali had left.

On June 22, he undid his jacket in the Allerton area of Bradford and showed the girls a black gun in a holster.

He told them he was working for the Secret Intelligence Service and that he had converted from Christianity to become a Muslim.

Ali then returned to the Haworth Road Medical Practice in Bradford and consulted Dr Nibofer Abbas.

He showed her the holstered gun and asked for a sick note, saying he was going to a war zone.

Later the day day, he showed Mark Hoy the weapon when he was serving him with an injunction.

Ali told the police he bought the gun for paintballing and used it for target practice in the woods.

Mr Weekes said he had a 2006 conviction for possession of kitchen knives.

A psychiatrist found that Ali was not a public danger.

Judge Thomas told him: "This is a sorry case, rather than a serious case of its type."

Ali was in a distressed state at the time and behaved in a bizarre fashion.

He had not harmed anyone and things were more stable for him now.

"There is a certain oddness about your situation and there needs to be a careful eye, quite frankly, kept on you," Judge Thomas said.

He urged Ali to "settle down and lead a sensible and lawful life."