Like several other countries in Latin America, Peru has a criminal statute for “femicide,” the crime of killing a woman or girl because of her gender. But it can be difficult to prove. Mr. Hualpa is being investigated for attempted femicide.

Social norms have yet to catch up with the legal standards, advocates say. Last year, a congresswoman, Maritza García, was forced to resign from her position leading a legislative committee on women and families after saying women “sometimes give men the opportunity” to kill them.

“Many times, you can have an aggressor who is acting totally normal and, suddenly, the woman makes him flip out by telling him: ‘I’m leaving you’ or ‘I’m cheating on you,’” Ms. García said. “Those phrases should never be said by a woman.”

One of the most notorious cases of sexual violence in recent years was in 2015 when Adriano Pozo was recorded attacking his girlfriend at the time, Arlette Contreras, at a hotel after a birthday party.

“I’m going to make love to you,” he told her, according to court papers. When she refused, he said, “Then I will rape you.”

At that point, Mr. Pozo pushed her to the floor, according to the court records. He choked her as she tried to resist, a medical report found. He allegedly threatened to kill her.

Ms. Contreras, a young lawyer, managed to escape from the hotel room. But Mr. Pozo, who was naked, chased her down to the lobby while being recorded by multiple security cameras.