The woman thought she was meeting a man who was going to pay her to have sex.

Instead, prosecutors said, he tried to kidnap her, forcing her into his car violently and driving off to a secluded location. The woman escaped by throwing herself out of the moving vehicle. The man returned later with a weapon to hunt her down, investigators said, but she was able to escape a second time.

The episode, in October 2018, was one of several violent encounters between the man, Andrew Frey, and female sex workers, according to federal prosecutors on Long Island.

On Friday, Mr. Frey, 54, of Long Island, was arrested and charged with two counts of attempted kidnapping and two counts of attempted sex trafficking.

Mr. Frey pleaded not guilty to the charges at a first appearance in Federal District Court on Friday. Wearing an olive green jacket, he was crying audibly and his shoulders were shaking.