Robert Lewis Dear, center, glancing at his public defender during a court appearance. (Andy Cross/Denver Post via AP)

A judge in Colorado said Wednesday that the man accused of a bloody rampage at a Planned Parenthood clinic last year is not mentally competent to stand trial.

The decision from Judge Gilbert Martinez of Colorado’s Fourth Judicial District will send Robert Lewis Dear Jr. to the Colorado Mental Health Institute at Pueblo for treatment and effectively puts the criminal case against him on hold. Dear faces 179 counts stemming from the shooting, including eight counts of first-degree murder as well as numerous charges of attempted first-degree murder and assault.

Martinez wrote that he found Dear’s “perceptions and understanding are not rational and are not grounded in reality.”

In his order Wednesday, Martinez quoted from a evaluation that found Dear “currently incompetent to proceed” because he has “a mental disability or developmental disability” keeping him from being able to rationally understand the trial and consult with his attorneys. The judge also cited police testimony about a range of delusional beliefs Dear had espoused, including his contention that the FBI has been following him, his suspicion that relatives were spying on him and his assertions that President Obama funds the Islamic State and plans to declare martial law.

The order signed by Martinez states that Dear will be committed to the mental health facility “for treatment directed toward restoring competency.” It also asks state officials to provide another report on Dear’s status in early August, with a review in the case scheduled for Aug. 11.

As he was led out of the courtroom, Dear shouted at Martinez after the judge announced his decision. “That’s called prejudiced! Prejudiced! Filthy animal!” Dear said, according to the Denver Post.

[What police say the accused Planned Parenthood gunman told them after the attack]

Martinez’s announcement comes after two hearings, held weeks apart, that sought to clarify whether Dear could stand trial for the shooting spree. He is accused of killing three people and wounding another nine during a November 2015 attack at the Planned Parenthood clinic in Colorado Springs.

day-long hearing in late April ended with no official determination about whether Dear was mentally competent and the rest of the testimony occurred this week. After that hearing, on Tuesday, Martinez said a decision would come Wednesday afternoon.

Attorneys had revealed in court filings that the court-ordered psychiatric evaluation found Dear to be incompetent, and mental-health evaluators said during the April hearing that Dear suffers from delusions. A police detective said that Dear appeared lucid during his interviews and had said he did not want to claim insanity.

Dear told authorities that after the shooting, he anticipated going to heaven and being met and thanked “by all the aborted fetuses at the gates of heaven,” according to police documents.

Police said Dear brought eight guns and a “homemade ballistic vest” to the clinic, which he told officials he found after asking for directions several times and, eventually, finding a phone book with Planned Parenthood’s information. Dear finally got the address by calling the clinic, police records state.

Dear tried and failed to set off an explosion during the episode, police said. He has been accused of killing three people: Garrett Swasey, 44, of the University of Colorado at Colorado Springs campus police; Ke’Arre Marcell Stewart, a 29-year-old Iraq War veteran and father of two; and Jennifer Markovsky, a 35-year-old mother of two who was at the clinic supporting a friend.

Police said that Dear yelled out statements about killing babies when he was taken into custody. They also said he recited Bible verses and called President Obama the “Antichrist.”

Further reading:

Dear’s comments about “no more baby parts”

Dear appeared in court in front of the rampage’s victims

This story has been updated.