A Old Whittington man waved a machete at police officers after threatening to shoot and stab them.
Terence Miller, 38, of High Street, pleaded guilty to affray in September and appeared at Derby Crown Court on Friday for sentence.
The court heard that in October 2014, Miller was walking along Chesterfield Road at around half midnight when he mouthed an obscenity at a police officer who was driving by.
Miller repeated the obscenity to the officer when he got out of the vehicle, but was not arrested and allowed to continue on his way.
David Thatcher, prosecuting, told the court: “He illustrated in colourful language that he would start stabbing police officers if he had to come to the station.”
Miller gave his full name and address to officers over the phone and referred to the previous incident.
Around 15 minutes later, Miller called police again.
Mr Thatcher said: “[Miller] said he would not only stab police officers but would get a gun and start shooting people too.”
Miller called again around three minutes later.
Mr Thatcher said: “He said he would come to the police station, stabbing and shooting police officers.”
After this call, police officers - including an armed unit - were sent to Miller’s address.
When officers arrived, Miller came to the doorway of his house carrying a machete, which was around two feet long.
Mr Thatcher said: “The defendant appeared in the doorway. He was waving the machete around [and] he was indicating words to the effect that he would get a gun and start shooting.
“Having waved the machete around... he was then informed there were armed police officers at the scene.”
Miller put down the machete at this stage and was cooperative with police.
He made full and frank admissions in police interview.
Miller told police that he had consumed 12 pints of lager and cider and was drunk.
Passing sentence, Recorder D Smith remarked that Miller was clearly drunk but said the incident was a “serious matter”.
Miller was handed a two year prison sentence, suspended for the next two years, and given 80 hours of community service.