LOS ANGELES — California appellate judges urged legislators to update an arcane 19th century law, as the panel reversed the rape conviction of a man who authorities say pretended to be a sleeping woman’s boyfriend before initiating intercourse.

The Los Angeles-based appeals court said the 1872 measure doesn’t give single women the same protections as their married counterparts in certain rape cases. Assemblyman Katcho Achadjian said Friday that he was outraged by the appellate court ruling and said he would reintroduce a bill next week to expand the law to include cases in which a perpetrator tricks a victim into having sex by impersonating their partner.

Julio Morales had been convicted and sentenced to three years in state prison, found guilty of entering a woman’s bedroom one night once her boyfriend had gone home and initiating sex while she was asleep, after a night of drinking.

Advertisement

But a panel of judges overturned the trial court’s conviction and remanded it for retrial, in a decision posted this week.

The victim said her boyfriend was in the room when she fell asleep. Morales pretended to be her boyfriend in the darkened room, and it wasn’t until a ray of light from outside the room flashed across his face that she realized he wasn’t her boyfriend, according to prosecutors.

‘‘Has the man committed rape? Because of historical anomalies in the law and the statutory definition of rape, the answer is no, even though, if the woman had been married and the man had impersonated her husband, the answer would be yes,’’ Judge Thomas L. Willhite Jr. wrote in the court’s decision.

The appeals court added that prosecutors argued two theories, and it was unclear if the jury convicted Morales because the defendant tricked the victim or because sex with a sleeping person is defined as rape by law.