A Drongan woman kicked out at cops after they found her drunk by the side of the road in Cumnock and offered to help her get home.
Lisa Hutchison lashed out at police after they stopped to offer help in Barrhill Road.
The 32-year-old admitted assaulting and injuring a female constable by kicking her on the body and resisting, obstructing or hindering her and a second officer.
At the scene, and during a journey from there to Kilmarnock police office that followed, Hutchison struggled violently at both cops, lashing out at them with her arms and legs.
The procurator fiscal depute told Ayr Sheriff Court: “At 12.10am police saw the accused walking along the road she appearing intoxicated. They were concerned about her.
"She appeared under the influence, with no means to get home.
"Officers requested a cell van to take her to her home address.
"However, she refused to get in the van and began shouting and swearing at officers.
"She refused to get in, and began shouting and swearing and threatening to 'do them'.
"She was then informed she was under arrest and was put in handcuffs.
"At this point she lashed out, pushing pulling officers and swinging her head and legs to her.
"In the cell cage police van, the accused remained extremely aggressive and was making threats to assault them. She continued this way thereafter at the police office.
"She struggled with officers throughout. Given her demeanour, she was not cautioned and charged, and was released when sober."
Sentence had been deferred for background reports following Hutchison's guilty plea at an earlier hearing.
Defence solicitor John Gallagher said: "It's a situation we've heard all too often in this court, of the police trying to offer assistance to someone while heavily intoxicated.
"Then, unfortunately, she reacted badly to efforts to assist her."
He explained his client had vulnerabilities with a "number of issues" adding: "I think the [social work report] just scratches the surface".
Sheriff placed Hutchison, of Sinclairston Drive, Drongan, on a community payback order for one year with social work supervision.
She was told to take part in drug and alcohol treatment during the lifetime of the order.
Comments: Our rules
We want our comments to be a lively and valuable part of our community - a place where readers can debate and engage with the most important local issues. The ability to comment on our stories is a privilege, not a right, however, and that privilege may be withdrawn if it is abused or misused.
Please report any comments that break our rules.
Read the rules here