The suit charges that in July 2016, Ms. Lapayowker rented a studio apartment in Los Angeles that was attached to the home of Carlos Del Olmo, listed as a superhost because of his positive reviews on the site. Though she rented the property for a month, the suit says she had stayed only three nights because Mr. Del Olmo’s behavior — making sexually suggestive comments, using drugs in front of his underage son, pounding on her windshield while she was sitting inside her car — made her uncomfortable.

According to the suit, the assault occurred when she returned a week after leaving the studio, to retrieve belongings she had left behind. Mr. Del Olmo told her that he wanted to show her something important inside the studio, the suit says, and locked the door after she followed him in. She was held in a chair, against her will, as he proceeded to masturbate in front of her, finally ejaculating into a trash can, the lawsuit says. Before she fled the scene, the suit charges, he said to her, “Don’t forget to leave me a positive review on Airbnb.”

When Ms. Lapayowker complained to Airbnb about the attack a month a later, the company immediately removed Mr. Del Olmo as a host from its site, according to Nick Shapiro, the company’s global head of trust and risk management. “We supported her right away and took him off our platform,” he said.

Mr. Shapiro would not comment on whether Airbnb knew that Mr. Del Olmo had previously been arrested, citing the Fair Credit Reporting Act, which prohibits the disclosure of the results of one user’s background check to another. He added that a background check had been done on Mr. Del Olmo and showed no prior convictions.

But Ms. Lapayowker’s lawyer, Teresa Li, said the company should have informed Ms. Lapayowker that Mr. Del Olmo had previously been arrested and charged with battery, in 2013, in Florida. He was accused of pulling his former girlfriend by her hair, from the back to the front seat of his car, in front of his child; Mr. Del Olmo was referred to an anger management program after the arrest, but was never convicted.