Mr. Lopez found himself in Madrid in the first place because he had such a great experience with Brazilian Airbnb hosts in 2014. His Madrid host told him to meet her at a subway exit near her residence.

When they arrived at her apartment and she locked them in, he said, she repeatedly tried to kiss him. He rebuffed her, and then she ordered him to take off his pants unless he wanted to sleep in the streets without his belongings, he said. As these events unfolded, he began messaging his mother, though by the time his mother realized that Airbnb would not give her his address and that she had to get it from him, he said, his host had cut off Internet access.

His host, meanwhile, began rattling around in the kitchen drawers, and Mr. Lopez said he feared that she had a weapon and concluded that the choice to leave was not a real one. After the sexual assault, it was not clear whether she would let him go, he said, and he began looking around for something that he could use to hurt her so that he could escape.

“I was telling myself that I was going to have to kill her or she was going to kill me,” he said. “Thoughts that should never have to go through anyone’s mind started to come into mine. How are you going to live with yourself the rest of your life knowing that you killed someone? But if you don’t, then you won’t have a life.”

He chose not to try to fight his way out and eventually concocted a story about plans he’d made to meet friends nearby. Those friends knew where he was staying, he told his host, and they would come for him or call the police if he did not meet them. This scared her enough that she let him leave with his belongings.

Mr. Lopez’s description of the episode, which he gave to me in a three-hour interview at his family’s home, matches the one he gave in his police report. The Madrid police would not comment on the investigation, though his host said that they had already visited her and that she expected to be exonerated.

According to Airbnb, this was a unique situation on a weekend when 800,000 people were staying worldwide with an Airbnb host. A number of the company’s safety procedures came into conflict. On one hand, Airbnb wants sexual assault victims to be able to decide for themselves when, how or if to report a crime. On the other, the company wants to report crimes in progress when customers are in danger and will turn over information quickly if the police request it.