LOS ANGELES (AP) – A federal appeals court has overturned a California man’s assault conviction after he went to trial without undergoing a sleep study to bolster his contention that he was sleepwalking.

The 9th U.S. Circuit Court of Appeals said Friday the failure to have Yun Liao undergo a sleep test left his defense weak during his 2003 trial in Los Angeles County. The court cited a subsequent sleep study that determined Liao was a sleepwalker.

READ MORE: Teachers Union Takes Legal Action Over Sac City Unified's 'Refusal' To Address Make-Up Days Related To Strike

Liao has served his time in prison and is now on parole. The 9th Circuit sent his case back to a lower court with instructions to release him from custody unless prosecutors decide to retry him.

An email to the Los Angeles County District Attorney’s office was not immediately returned.

READ MORE: Deadly Stabbing, Robbery In Fairfield Results In 2 Arrests

Liao was accused of attacking his ex-girlfriend’s son with a hammer.


MORE NEWS: Getting Answers: What Does Trump's Endorsement Of Congressional Candidate Kiley Over Jones Mean For Primary Voters?

Copyright 2016 The Associated Press.