A suicidal Suffolk man who pointed a realistic imitation handgun at armed police because he wanted them to shoot him has been jailed for three years.

Sentencing 49-year-old Matthew Prettyman, Judge Rupert Overbury said he had been "moments away" from being shot.

"An armed police officer was put in a situation where he believed you were going to shoot him. He said it was the closest he had come to discharging his firearm in ten years of service," said the judge.

He accepted Prettyman's behaviour had been affected by his mental state at the time.

Prettyman, of Beech Close, Halesworth, admitted possessing an imitation firearm, namely a BB air gun, on July 26 last year with intent to cause fear of violence.

The court heard that the alarm was raised after Prettyman told a mental health worker he had a gun.

Prettyman was contacted by phone by a police negotiator and firearms officers were sent to his home address but he wasn't there.

He was later found sitting in his car outside his brother's house in Mountbatten Road, Bungay and he was asked to get out of the vehicle, said Phillip Farr, prosecuting.

"Officers were aware there was a black handgun in the car and told him to open the door. Officers then saw him lift his right hand towards his chest to reveal a black pistol similar to the Glock pistols they used," said Mr Farr.

Prettyman was told to put the gun on the passenger seat but instead he pointed the gun out of the driver's door towards two officers in an "extremely frightening way", said Mr Farr.

"Fortunately the gun was put down by the defendant otherwise one of the officers said he would have had no choice but to shoot the defendant.

"The officer said it was the closest he had come to discharging his firearm in ten years of service," said Mr Farr.

Prettyman had then agreed to throw the gun out of the window and he was arrested.

He later told officers he was suicidal and had sourced a good replica gun with the intention of getting police officers to shoot him.

Andrew Thompson, for Prettyman, said his client had long-term mental health issues and had been diagnosed with prostate cancer and had a heart condition.

The court heard that the prostate cancer had responded well to treatment and he no longer wanted to die.

"He didn't intend to hurt anyone," added Mr Thompson.