A man who claimed to suffer from "sexsomnia" — a condition in which a person engages in sexual activities while asleep — has been sentenced for raping his roommate's teenage friend at an apartment in Davis, a city in the US state of California.

Najee A'Ve was sentenced to three and a half years in prison in September after he was found guilty of two felonies, including rape of an unconscious person and penetration with a foreign object of a person younger than 18, The Sacramento Bee reported.

A'Ve had raped the 17-year-old victim when he was living in a shared apartment and was taking summer school classes at Sacramento State University. He was reportedly applying to UC Davis at the time.

Chief deputy district attorney Jonathan Raven said that on 2 August 2013, the accused went out for drinks and returned to his apartment heavily intoxicated. That night the teen — a family friend of one of A'Ve's roommates — was staying at the apartment and sleeping on a couch downstairs when she woke up to find A'Ve raping her.

The girl managed to flee and informed family members, who called police.

Though A'Ve claimed that he did not remember anything from the night of the incident, Raven added that a "DNA sample was collected from the victim and analysis showed a DNA match for A'Ve".

The man's attorneys argued that A'Ve suffered from sexsomnia. Though the argument was rejected in court, judge David Reed found him not guilty of assault with intention to commit a sex crime on a minor.

Reed also ruled that A'Ve was not eligible for probation in part because he continued to drink despite his criminal conduct when drunk. The convicted felon has also been ordered to register as a sex offender after his release from prison.