A drunk, off-duty police detective dropped his pants and exposed himself to a mother and her young son, a court has heard.

The detective, who works at Police National Headquarters, is facing a charge of offensive behaviour and exposing himself. He denies the allegations, and has name suppression.

The woman yesterday told the Pukekohe District Court she was picking up her homesick 11-year-old son from a sleepover about 2am on New Year's Day and decided to drop some clothes off at the Salvation Army on her way home.

The woman said she was approached by a man who stood in front of her car and stopped her from pulling out of the car park.

She said the man asked her: "What the f*** am I doing out on the street with my child at that time of night."

The woman said he was slurring his words and she was frightened.

She said the man then showed her a detective's badge which she thought could be fake.

The woman wound down the window and took it out of his hands.

But she said the badge looked authentic and the photograph in the wallet matched the man. She said she told the police officer that his fly was undone, and he "chuckled a little bit and stepped backwards".

"He began to fumble with the dome on his pants and he was still chuckling as if he found the situation very funny. It was then that his pants fell down to his knees area. I saw his penis," the woman said. She said thankfully her son was looking away.

The woman was then approached by another off-duty police officer who she thought might be coming to help her. "The man asked me what the f****** problem was," she said.

The woman said both police officers were obviously drunk.

She said she was fearful for the safety of her son and herself and drove around the block before heading to an all-night petrol station where she asked staff to call police. Both officers followed her, she told the court. The detective stood in the doorway while she asked an attendant - through the night-pay window - to call police.

The detective also gave evidence, denying exposing himself, and saying he did not even recognise the woman at the petrol station. He said he was urinating on a tree in the Pukekohe main centre when he noticed a suspicious looking car and heard a "metallic sound" near the Salvation Army.

The detective said he stopped the car on the street but it sped away.

He denied removing his trousers, and described himself as "moderately intoxicated". However, that was contradicted by evidence from petrol station staff, two constables and Senior Sergeant Stephen Greally, who said the man was "highly intoxicated".

The hearing is expected to finish today.