NEWPORT BEACH, Calif. — A California man denied Wednesday that he killed a University of Pennsylvania student because the victim was gay.

Samuel Woodward, 21, who has pleaded not guilty to a murder charge, appeared in court and also denied a hate-crime allegation connected to the killing of 19-year-old Blaze Bernstein, the Orange County Register reported.

Bernstein's body was found in a shallow grave in January at a park near his parents' Lake Forest home.

investigators reviewed Woodward's cellphone, laptop and social media accounts and found hateful material against a range of groups and substantial evidence that Bernstein was killed because he was gay, Orange County District Attorney Tony Rackauckas said earlier this month.

Woodward's lawyer, Edward Munoz, told the newspaper that Woodward suffers from a "serious mental disorder" and struggled with his own sexual identity.

The attorney said Woodward has Asperger syndrome, a developmental disorder that generally causes difficulty with social interactions.

Munoz told BuzzFeed News that his client "has a lot of issues, I think, around sexual orientation."

"There's going to be some evidence that comes out that shows he's very confused," he said.

Bernstein — who attended the same high school as Woodward — disappeared in January while visiting his family on winter break.

His body was found nearly a week later buried in a shallow grave at a neighborhood park where he went with Woodward on the night he disappeared.

Woodward told investigators that he became angry after Bernstein kissed him that night, according to a court filing obtained by the Orange County Register after the killing.

A preliminary hearing in the case was postponed Wednesday. Woodward could face a sentence of life without parole if convicted.