Adam Burgin, 29, viciously attacked PC Dan Lumley after the officer had been called to reports of the defendant in possession of a baseball bat and threatening to kill members of his family in the Thrybergh area of Rotherham.
Sheffield Crown Court heard how PC Lumley was first at the scene on September 2, last year and on his own when he made the brave decision to get out of his car and try and deal with events unfolding.
Judge Mrs Recorder Kate Batty praised the officers actions in court on Tuesday and said: "His intention was to calm the situation down, but you (Burgin) approached him in an aggressive way with your fists clenched. He knew you were going to assault him and as a result he drew his pava spray and sprayed you to stop any violence and in my opinion that was a perfect step to take.
"You came to him, windmilling your arms and you pushed him to the ground. He managed to get on top of you and you remained on the ground. He was telling you to stay down, but you didn't, you kept trying to get up. In my judgement you were angered at the officer getting the better of you. You grounded him by grabbing his legs and flipping him up and repeatedly punching him.
"You can hear the panic in his voice during his radio call."
The attack also left him questioning why he joined the force.
Prosecuting Zaiban Alam read out a statement in court on Tuesday from South Yorkshire Police Chief Constable Stephen Watson following the attack.
The statement said: "Our officers live among the community they serve. We must not lose sight of the fact they have families of their own that these attacks have a significant impact on.
"Being attacked on duty is not part and parcel of the job. They are being subjected to threats and assaults at all times and it has a significant effect when they return to the front line. Those that choose to assault police officers must be dealt with by the courts."
His sentencing was delayed until today so he could attend his grandmother's funeral.
In mitigation, Richard Adams said Burgin's attack was self-defence, albeit excessive, after he had been parva sprayed by the officer. He said Burgin, who had been drinking alcohol, was confused.
Mr Adams said a prison sentence would result in Burgin losing his employment and it would also be the first time away from his partner, who recently had cancer treatment, and their two young children.
"He did his job and for his troubles he was on the receiving end of the most terrifying event of his career."
"The public must know that if they assault police officers they must go to prison."