Western Australian assistant commissioner Gailene Sharron Hamilton, 49, has pleaded not guilty to pursues another to intimidate and four counts of unlawful use of a computer in 2024 and 2025.
Hamilton, who was stood down from the police force in 2025, held the lower rank of superintendent when some of the alleged offending took place.
The complainant, a lower-ranking female officer who cannot be identified for legal reasons, says the pair met on the job in 2023 and were initially mates.
But the friendship soured amid Hamilton's repeated text messaging, calls and visits to her home.
"I wasn't comfortable with the frequency, and I just didn't want Gailene staying as often as she did," the woman told the Perth Magistrates Court on Monday.
The officer said she tried to tactfully hint to Hamilton that she didn't want to be close friends but was also fearful of potential repercussions for her career due to the power imbalance between them.
"It was a friendship I wasn't comfortable with, and I couldn't say that," she said.
"I didn't want to upset her. I didn't know how to deal with it."
The pair argued during one of Hamilton's visits following her repeated text messages, which were often to check if her friend was OK.
"I remember saying I feel like I'm in a relationship," the officer said.
"I also remember saying, 'I'm 52, and I don't need you to worry about me'.
"She started to cry."
Hamilton's messaging continued for months, and the woman eventually tried to end the friendship.
"I just couldn't believe they would be so continuous," she said.
"I sent a message saying, 'Please stop contacting me'.
"I just didn't have the energy. I just didn't want to get involved in a texting war or having to explain."
Hamilton's alleged attempts to contact the woman continued.
Opening the case against Hamilton, prosecutor James Bennett said it was "essentially a friendship gone wrong".
"The accused didn't take the hint," he said as he detailed the case against her.
Hamilton's alleged actions cause her victim fear, anxiety, apprehension and stress, he said.
She is also accused of using a police app to locate her alleged victim on four occasions.
The software can legally only be used for work purposes, but Hamilton allegedly used it to check on the woman while she was staying at her house and when she was travelling.
The five-day trial continues on Tuesday.