A woman will spend almost a week behind bars after allegedly squirting a police officer with breast milk while she was being searched in Rockingham.

Calista woman Erica Leeder, 26, was denied bail in Fremantle Magistrate's Court yesterday after a charge of assaulting a public officer.

Ms Leeder was being searched at Rockingham police station after her arrest and was naked from the waist up when the alleged incident against the female police officer occurred on Tuesday.

Ms Leeder is alleged to have grabbed her breast and squirted the milk on to the officer's forehead, arms and clothing.

WA Police Union said it had never heard of a similar case and there was a chance of disease transfer from breast milk.

Ms Leeder has a previous conviction for assaulting a police officer, and when denying the woman bail the magistrate told her it was because of her history of violence.

She has been remanded in custody until Tuesday and has been ordered to have a mental health assessment.