A man who repeatedly threatened police until he had to be pepper sprayed has narrowly missed a prison sentence.
Joshua Daniel Black flew into a rage on March 28 after arguing with his partner, breaking two windows and kicking down a door, said police prosecutor Sergeant Stephen Butler.
Whanganui District Court heard how three police officers arrested Black, all the while being threatened and abused.
Black has since moved out of Purnell House where he was staying with his partner, with whom he has a child.
Lawyer Raukawa Simon said Black "lost his cool with his girlfriend and then lost his cool with police."
Black received a four month prison sentence last year for threatening to kill.
Judge David Cameron sentenced him to 60 hours' community work for behaving threateningly and wilful damage, but warned him any breaches would land him in jail.
He had poor compliance in the past with community work.
"In one sense, it's your lucky day," said Judge Cameron.
"You breach it you will be sent to prison, it's really simple."
He also ordered Black to pay $200 for the windows.