An Indiana judge ruled Wednesday that a man accused of raping, killing and eating parts of his ex-girlfriend’s dead body is not mentally competent for trial.

The judge in Clark County made the decision based on testimony from doctors who treated Joseph Oberhansley, 34, Fox 8 reported.

Oberhansley confessed to fatally stabbing his ex-girlfriend, Tammy Jo Blanton, 46, in Sept. 2014. He told police that he broke into her home, killed her and cooked and ate her body parts, including her heart, lung and parts of her brain.

FBI ADDS NC MURDER SUSPECT TO ‘MOST WANTED’ LIST, OFFERS $100G REWARD

He was charged with rape, murder and abuse of a corpse and could have faced the death penalty if convicted.

Oberhansley’s defense team officially filed their concerns in February, arguing that their client couldn’t understand what was going on in the trial and said he “consistently appeared irrational and expressed bizarre thoughts at hearings.”

“He is suspicious, paranoid, uncommunicative, and agitated,” they wrote in the motion, according to Fox 8.

The judge reportedly ordered competency evaluations to be completed by psychologists and psychiatrists, who testified that he was not fit for trial.

MS-13 HAS NEARLY AS MANY MEMBERS AS POLICE IN ONE WEALTHY VIRGINIA COUNTY

joseph Oberhansley

Doctors testified in court Wednesday that Oberhansley, shown being escorted through the Clark County Courthouse in 2015, was not fit to stand trial. (AP)

Prosecutors said they plan to bring Oberhansley back to court at some point after he receives treatment for “competency restoration,” Fox 8 reported.

“I had hoped that it would be tried before now,” prosecuting attorney Jeremy Mull told the Courier Journal. “But my main priority is getting a verdict that is going to stand, that is going to survive appeal…”

Oberhansley has maintained his innocence throughout the legal process, once yelling to the judge in court, “You have the wrong guy.” Before his hearing on Wednesday he told reporters he was “outraged by these false charges against me,” WDRB reported.