(CNN) -- California's top prosecutor will seek a change in an 1872 state law after an appeals court cited "historical anomalies in the law" when overturning a rape conviction of a man who allegedly pretended to be an 18-year-old woman's boyfriend in a dark bedroom.
The appeals court ordered a retrial in the 2009 rape case.
"This law is arcane and I will work with the Legislature to fix it," Attorney General Kamala D. Harris said in a statement Friday. "The evidence is clear that this case involved a nonconsensual assault that fits within the general understanding of what constitutes rape."
This week, the California Court of Appeal overturned the rape conviction of Julio Morales, who was accused of raping an 18-year-old acquaintance after her boyfriend left the bedroom and she fell asleep.
The court laid out the unusual circumstances of the case and problems in the 1872 law in the first paragraph of its ruling Wednesday:
"A man enters the dark bedroom of an unmarried woman after seeing her boyfriend leave late at night, and has sexual intercourse with the woman while pretending to be the boyfriend," the court wrote.
"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," the court said.
Los Angeles County prosecutors charged Morales with rape of an unconscious woman under the 1872 law, the court said. He was eventually convicted and sentenced to three years.
During the trial, the jury was instructed that "[a] woman is unconscious of the nature of the act if she is unconscious or asleep or not aware that the act is occurring or not aware of the essential characteristics of the act because the perpetrator tricked, lied to, or concealed information from her."
The prosecutor argued correctly that the 18-year-old woman was asleep, but argued incorrectly that the woman wasn't aware of the act due to Morales' alleged deception about being her boyfriend, the court said.
In conflicting testimony, the defendant testified at one point that he told the woman he wasn't her boyfriend, the court said.
"Because we cannot discern from this record whether the jury convicted defendant on the correct or incorrect theory, we must reverse," the court said.
"We conclude that under the peculiar facts of this case, reversal is required because the prosecutor argued an incorrect theory of guilt, the instruction permitted the jury to convict on that theory, and the record does not permit us to find that the jury relied only on the prosecutor's correct theory," the court said.
Morales' court-appointed attorney, Edward H. Schulman, said the retrial must omit the controversial instruction about an unconscious rape victim not being aware of "the essential characteristics of the act because the perpetrator tricked, lied to, or concealed information from her."
The retrial would be Morales' third trial, Schulman told CNN. The first trial resulted in a hung jury, and the second convicted Morales, he said. Morales is now in his early 20s, the attorney said.
State Assemblyman Katcho Achadjian said Friday that he will reintroduce legislation to close the loophole that resulted in the reversal. He first proposed such legislation last year after a woman in Santa Barbara County was raped in her bedroom. The woman first thought the attacker was her boyfriend and initially consented to sex. The county district attorney was unable to prosecute the man with felony rape.
"Californians are justifiably outraged by this court ruling, and it is important that the Legislature join together to close whatever loopholes may exist in the law and uphold justice for rape victims," Achadjian said of the Morales case.
CNN's Stefan Simons contributed to this report.
™ & © 2013 Cable News Network, Inc., a Time Warner Company. All rights reserved.