Marium Varinauskas, 28, was fined $900 on Monday for attempting to assault a female police officer with his penis.
The Lithuanian man had been arguing with his girlfriend when police were called to his apartment in Aberdeen, Scotland. When officers arrived Varinauskas was drunk and in his underpants.
Fiscal depute Elaine Lynch told the court: "The accused got to his feet and was standing over the police officer exposing his penis and thrusting it in her face, forcing her to take evasive action to avoid getting struck."
Varinauskas was arrested by the officers and led out of the apartment building in his underwear. His lawyer told the court his client could not remember the incident but accepted the police officer's version of events.
"He apologizes profusely and is extremely embarrassed," the lawyer added.
Varinauskas has now quit binge drinking.
A police spokesman said: "This was a distasteful experience for the officer."