A California teenager accused of molesting and drowning a 4-year-old neighbour boy and hiding his body in a clothes dryer was convicted of first-degree murder on Friday.

A judge also found 15-year-old Raul Castro guilty of lewd and lascivious conduct and sodomy. The judge found Castro not guilty of kidnapping.

Castro was tried as an adult in the October 2009 killing of Alex Mercado. Castro was 14 when he drowned the preschooler in a bathtub after the child said he would tell his mother about the sexual assault.

The Mendota teen confessed in taped interviews with detectives to sexually assaulting and killing the boy.

Castro’s defence attorney, Barbara Hope O’Neill, argued the teen was mentally ill and did not intend to kill Alex. O’Neill based her argument on the testimony of a psychiatrist who said Castro’s mental illness led him to disassociate with reality.

The doctor testified that Castro has a history of depression, suicidal behaviour, hallucinations, bipolar disorder and anxiety.

He also said the teen had suffered physical abuse as a toddler by his mother’s boyfriend. Castro had an out-of-body experience as he killed and sexually assaulted Alex, psychiatrist Avak Albert Howsepian said.

But prosecutor Robert Romanacce challenged the doctor’s credibility. The murder was premeditated, the prosecutor said, and Castro was in a clear state of mind at the time.

A judge decided the case after Castro waived his right to a jury trial.

Sentencing is scheduled for June 24