Portland police say they arrested a Lyman man who claimed to be a police officer and demanded sex from a woman.

Gary Mariner, 57, was arrested Thursday and charged with gross sexual assault and impersonating a public servant, police said.

A 24-year-old woman, who said she is a prostitute, said Mariner picked her up Thursday and told her that he was a police officer, showing the woman a badge and a handgun. He said he would arrest the woman unless she performed a sex act. The woman said she was released unhurt after she performed the sex act.

Police said there’s no indication from records at the Maine Criminal Justice Academy that Mariner has ever been a police officer in Maine.

He is being held in the Cumberland County Jail with bail set at $100,000.