Detectives were investigating a Sheffield shooting that had taken place earlier that day when two officers from South Yorkshire Police visited the property of James Maughan on March 6 this year, as part of the investigation.
When the two officers arrived at the property Maughan, of Fox Hill Road, Birley Carr peered out of an upstairs window, prosecutor, Richard Thyne, told the court.
The officers asked him to come and answer the door, but he refused, telling them they would have to 'come and get him'.
"The defendant said to the officers: 'Come on then, you know what these stairs are like. They're narrow, I'll get the first shot off'," Mr Thyne said.
Maughan, 24, was arrested at the scene a short time later, and continued to make threats to officers.
Mr Thyne added: "He said he was prepared to shoot himself, and would take them with him. He said they would be licked, which they took to mean they would be killed."
Despite the threats made by Maughan, no weapons were found at his property.
Mr Thyne told the court that no charges were ever brought against Maughan in relation to the shooting South Yorkshire Police were investigating when the officers visited his property.
Maughan pleaded guilty to making threats to kill during the sentencing hearing at Sheffield Crown Court on Wednesday, May 30.
He has previous convictions for offences of assault occasioning actual bodily harm, battery, causing death by dangerous driving and threatening behaviour, the court heard.
In mitigation, Maughan's barrister, Glenn Parsons, told the court that Maughan felt like he was the victim of an ongoing campaign of police harassment when he committed the offence.
"He has admitted that he was trying to put his criminal past behind him, but police were regularly his house, searching his home, none of which led to anything," said Mr Parsons, adding: "This put a huge amount of strain on his family. He's trying to support his partner. They have three children together, one of whom was just one-month-old when the police attended at the house."
Judge Jeremy Richardson QC sentenced Maughan to 15-months in prison.
He told him: "The threats you made were to police officers. I regard that as a serious feature of this case.
"The police officers are public servants. They, each of them, have a very difficult task to perform. They are deserving of protection."