COLORADO SPRINGS — Robert Lewis Dear Jr. twisted his head over his right shoulder and shouted at no one in particular:

“Anybody want to know why I did it?”

But after more than four months of outbursts and bizarre explanations, the man accused of shooting and killing three people at a Planned Parenthood clinic was led out of a courtroom Wednesday and is on his way to the Colorado Mental Health Institute at Pueblo.

Fourth Judicial District Chief Judge Gilbert Martinez found that Dear is not mentally capable of participating in and understanding the case against him.

After hearing hours of testimony from two state psychologists who evaluated Dear at the state hospital, Martinez said he agreed with the evaluators’ opinion that Dear is not competent.

Martinez also accepted the psychologists’ conclusion that Dear suffers from a delusional disorder. Dear’s delusion — which he has held for decades — that federal agents are out to get him is influencing his decisions and preventing him from working with his attorneys.

Dear believes his attorneys, prosecutors and the judge in his case are working for the federal government and seeking publicity.

As deputies led him out of the courtroom, Dear yelled at Martinez, who he claimed declared him incompetent months ago.

“That’s called prejudiced! Prejudiced! Filthy animal!”

Dear faces 179 counts — including eight charges of first-degree murder — for the Nov. 27 shootings at the Colorado Springs clinic.

The 57-year-old is accused of opening fire in the parking lot before storming into the clinic with multiple guns. Before the five-hour standoff was over, three people were dead and nine others were transported to the hospital with gunshot wounds.

University of Colorado-Colorado Springs Police Officer Garrett Swasey, Ke’Arre Stewart, 29, and Jennifer Markovsky, 35, were killed in the attack.

Dear has not entered a plea. Martinez’s ruling essentially halts all proceedings in the case for now.

Dear will be transferred to the state hospital, where he will undergo restoration treatment. Under state law, the hospital is required to provide the judge with written reviews of Dear’s status every 90 days. The first review is due Aug. 11.

There is no time limit for restoring Dear’s competency.

Dear’s outbursts in the Colorado Springs courtroom had become routine since his arrest. Each explanation for the attack became more elaborate than the last.

During his first in-person court appearance, Dear declared his guilt and claimed he was a “warrior for the babies.”

Months later, Dear cited Bible verses he claims explain why President Barack Obama is the antichrist.

On Tuesday, as one of the psychologists who evaluated Dear was testifying, Dear repeatedly urged people in the courtroom to “Wake up!”

Dear claimed that the same federal agents who were after him also were responsible for the deaths of Robin Williams and Princess Diana. Minutes after making that statement, an emotional Dear explained that he “just happened to love people.”

“I don’t like to see them get whacked,” he said.

By the time Dear raised his question to the busy courtroom Wednesday, attorneys, observers and reporters — all of whom had grown accustomed to the outbursts — continued their conversations. A deputy quietly asked Dear to stop.

Martinez read his eight-page ruling and listed more than a dozen statements Dear made that he felt supported his ruling.

“I didn’t list each and every comment the defendant made,” Martinez told the courtroom.

Prosecutors had argued that the psychologists who evaluated Dear at the state hospital lacked neutrality and failed to tease out critical information from Dear before determining he was not competent.

They suggested Dear was capable of working with the public defenders assigned to his case but was choosing not to.

“It is what it is,” 4th Judicial District Attorney Dan May said after Martinez read his order.

May declined to comment on how his office will handle the case while Dear is undergoing restoration treatment. Prosecutors discussed Martinez’s ruling with victims, but May declined to share details of those conversations.

“Nobody has said that he’s permanently incompetent,” May said.

Jordan Steffen: 303-954-1794, jsteffen@denverpost.com or @jsteffendp