Ron Jeremy isn't going before a jury to face rape charges, because he's being shipped off to a mental hospital ... where he could spend the rest of his days.
The former porn star -- who'd been hit with a 30-count indictment alleging rape, sexual assault and other related crimes -- was committed to a state-run mental hospital in California ... this after being deemed unfit to stand trial.
A judge signed off on Jeremy's fate last month -- ruling that his cognitive ability was in a state of such decline that he couldn't facilitate his own defense.
He can be held for up to two years at the facility ... and there will be periodic checkups to see if his condition improves. The first hearing on his progress is scheduled for early May.
As we reported ... during a hearing last month the judge was informed, after a battery of tests Jeremy was diagnosed with dementia.
They left the door open to continue pursuing charges against him if his condition improves, but for now ... he'll remain at the facility.
Jeremy has been accused by several women of misconduct dating back decades. He pled not guilty in 2020, and his attorney had told the media it's a shame RJ wouldn't get a chance to clear his name in court due to his mental condition.