The woman was out celebrating Valentine's Day with a group of friends when a fight started.

A Hamilton woman who spat in a police officer's eye then told him she had herpes has escaped conviction.

Her lawyer says the incident was out of character and happened when she had been drinking.

Logan May Gardiner, 21, was in the city celebrating Valentine's Day with a group of friends when they were ejected from a bar.

But when police officers tried to break up a fight involving Gardiner's boyfriend, she got increasingly riled before spitting in a police constable's eyes and told him: "I've got herpes, I hope you like it".

READ MORE:

* Dunedin police officers spat on, blood tests needed

* New Plymouth woman pleads guilty to spitting in police officer's face

* Southland police spat at, court told

* South Canterbury cop punched spitting youth, court told

She was sentenced in the Hamilton District Court on Tuesday on charges of assaulting a police officer and disorderly behaviour and a breach of bail - relating to another matter - and discharged without conviction.

Gardiner's offending happened about 1am on Sunday, February 15, 2015 when a fight broke out on the street in front of patrolling police officers.

Gardiner's boyfriend was pulled from the melee and she started swearing at police, and later hit and kicked a constable, despite repeated warnings and being pepper sprayed.

She refused to sit down so a constable put his hand on her shoulder, which she tried to bite, then spat in his eyes when he went to lead her away.

However, the behaviour was very much out of character and Gardiner accepted that she had used poor judgement, defence counsel Rob Weir said.

"In a drunken state she went to somebody's assistance, interfered with the police... and feels extremely remorseful."

Gardiner had started a pharmacy career, which a conviction could affect, and had recently had her first child, Weir said.

Police prosecutor Sergeant Andy Kennedy opposed discharge without conviction.

That left Judge Menzies balancing Gardiner's "unwarranted, aggressive and offensive" behaviour with her lack of previous convictions and the long working life ahead of her.

He discharged Gardiner without conviction on all three charges but ordered her to pay $350 for emotional harm to the constable.