Despite acknowledging that the defendant was “quite mentally ill,” a judge ruled Thursday that John Woody Jr. was legally sane when he stabbed a man to death at a Paso Robles Laundromat.

Woody, 30, of San Jose, will be sentenced Dec. 20 for first-degree murder. He had previously been convicted by a jury. The second phase of the trial — to determine whether Woody was sane at the time — was a trial heard by Superior Court Judge Michael Duffy, who said the prosecution’s psychiatric experts were more convincing.

On March 6, 2011, Woody entered the Paso Robles Laundromat on Spring Street, approached its lone customer, Martin McWilliams, 46, of Paso Robles, and began furiously stabbing him. McWilliams managed to break away from his attacker, but he bled to death on the street in front of the establishment, having received 30 stab wounds.

During the trial, defense attorney Ken Cirisan argued that Woody — who has been involuntarily committed several times in the past — was hearing voices when he stabbed McWilliams.

“He was symptomatic, fearful and couldn’t separate reality from the voices in his head,” Cirisan told the judge.

But Deputy District Attorney Matt Kerrigan said a person who commits a crime in the throes of hallucinations and delusions can still be considered legally sane if they knew and understood the nature of the act and knew the difference between right and wrong.

“Most people suffering from schizoaffective disorder don’t take a knife out and kill people,” he argued.

Cirisan said Woody made a deal with the voices in his head: If he hurt someone, the voices would leave. McWilliams, whom Woody believed was the source of one of the voices, was in the wrong place at the wrong time, Cirisan said previously.

Kerrigan, who argued that Woody was more guided by an antisocial personality disorder than his mental illness, said McWilliams — who was doing his family’s laundry that night — had a right to be where he was.

“I think Mr. Woody was in the wrong place at the wrong time,” he said.