David Paradiso, 28, was shot by a police detective after he left the witness stand and began attacking San Joaquin County Superior Court Judge Cinda Fox during a break in proceedings, said Dave Konecny, a spokesman for the sheriff's department.
Paradiso had been testifying around 2 p.m. when his mother, in the audience, left the courtroom upset. Fox called a recess, and as jurors filed out, Paradiso left the stand and approached the judge from behind "with an unknown cutting instrument," Konecny said.
Lodi police detective Eric Bradley, an eight-year veteran and the lead investigator on Paradiso's case, drew his weapon and killed Paradiso, reports CBS13 in Sacramento. He has been placed on administrative leave while the shooting is being investigated, said city spokesman Jeff Hood.
Karen McConnell, a county spokeswoman, said witnesses reported seeing Paradiso lift the judge and begin punching and possibly stabbing her when bailiffs ran to her aid and shots rang out.
Fox, who had a bandage on her left arm as she was carried out of the courthouse on a stretcher, told reporters, "I'm OK," before being taken to a hospital. Calls to her home were not immediately returned.
San Joaquin County officials say she is recovering from non-life threatening wounds, CBS13 reports
The courthouse immediately went on lockdown, although people were allowed to leave after the building was secured, McConnell said.
Konecny said he did not know how Paradiso obtained a weapon. He said at least two bailiffs were on duty in the courtroom at the time of the attack.
Paradiso's mother, Debra, was enraged as she walked out of the courthouse after the incident and told CBS13 that she warned authorities that David was prepared for violence.
"He had a weapon. We called, we told the jail two weeks ago, they searched his cell and they didn't find it," Mrs. Paradiso said. "Why didn't they thoroughly search him before he went in there [today]?"
"He [David] jumped up on the thing, he tried to stab the judge, he stabbed her, they shot him in the head and they killed him," she cried. "They didn't believe he was crazy! Now do they believe he's crazy? What the [expletive] does it take?"
Aaron Paradiso, the suspect's brother, also said that they had warned authorities that David was dangerous.
"We reported all the mental problems, they were all documented, he told his lawyer he didn't want to go on the stand," Aaron Paradiso said. "Well, it's over now, right?"
(Watch local video of Paradiso's mother and brother from CBS13 below.)
Paradiso was on trial for allegedly stabbing his girlfriend, Eileen Pelt, in the neck as his mother drove them in her car. Debra Paradiso told police her son forced her to drive to Amador County, where he dumped the body.
Paradiso's attorney, Charles Pacheco, said in opening arguments last week that his client was high on methamphetamine at the time. Pacheco did not immediately return a call Wednesday seeking comment.
Concerns about courthouse security have grown since 2005, when an unshackled defendant being escorted into an Atlanta court for a rape trial stole a deputy's gun and went on a shooting rampage. A jury found Brian Nichols, 37, guilty in November of murdering the deputy, a judge and two others.