A court was shown footage of the female officer dazed as she lay on the ground with a head wound during the incident in Chapeltown.
Leeds Crown Court heard Elijah Skellington carried out the attack when police were called to the area on July 5 last year.
The court heard that the officers were responding to a report that Skellington had been seen kicking the door to a property.
Officers tried to stop the defendant from running from the scene and a struggle followed.
During the struggle one of the officers dropped a baton which Skellington managed to pick up and hit the female officer over the head.
The incident was captured on one of the officer's body-worn cameras.
Skellington was detained on the ground and handcuffed by the other officers.
He tried to bite and spat at a male officer.
Skellington, 29, of no fixed address, pleaded guilty to assault occasioning actual bodily harm and assault by beating.
He has previous convictions for violence.
The court heard Skellington is currently receiving psychiatric treatment in New Lodge Secure Unit, in Wakefield.
Emily Hassall, mitigating, said the defendant had been responding well to treatment and doctors hoped to be able to discharge him in the near future.
Skellington was given a 28-week prison sentence, suspended for two years.
He was also ordered to pay £400 compensation to the officer he struck over the head and £100 to the officer he spat at.
Sentencing Judge, Recorder Andrew Latimer, said: "It is obvious that you had some physical strength and you were prepared to use that.
"Police officers are just like anybody else. They would suffer distress if someone tried to bite them or spit at them from close range.
"I want you to know, Elijah Skellington, how close you have come to going to prison today.
"It is important to understand that even a person who is sectioned under the Mental Health Act does not have licence to use violence."