A legal loophole has allowed an accused rapist in the US to escape conviction after he pretended to be a woman's boyfriend and snuck into her bedroom and had sex with her.
A California court overturned the case after it concluded that the victim would have to be married for the assailant to be guilty of rape.
The woman alleged that she woke up to a man having sex with her after she had fallen asleep under the influence of alcohol.
The victim's boyfriend had left her home after he decided not to spend the night with her after walking home from a party.
She then woke up when she felt Morales on top of her but was unable to see him until a flicker of light revealed his identity.
The victim told the court she screamed after she realised Morales was not her boyfriend and pushed him away.
Morales's lawyers claimed that he did not remember being pushed away and that he did not do anything against the woman's will.
The woman pressed charges and Morales was sentenced to three years in jail.
But the decision was overturned by California's Second District Court of Appeals after examining a law from 1872 which only protects married victims if they are raped while sleeping or unconscious.
"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 said in its ruling.
"Has the man committed the rape? Because of historical anomalies in the law and the statutory definition of rape, the answer is no even though if the woman had not been married and the man had impersonated her husband, the answer would be yes."
After claiming the conviction was faulty, Morales's sentence may now be lifted.