Tucson, Arizona (CNN) -- Jared Lee Loughner, accused of a mass shooting in which he allegedly tried to assassinate U.S. Rep. Gabrielle Giffords of Arizona, isn't competent to stand trial, a federal judge ruled Wednesday.

U.S. District Judge Larry Burns said he based his decision on two recent court-ordered mental evaluations of Loughner at a federal hospital in Springfield, Missouri.

"The defendant was not able to comprehend the charges," Burns said.

Loughner has been diagnosed with paranoid schizophrenia by two experts who examined him, Burns said.

A 52-page evaluation by psychologist Christina Pietz and a 43-page evaluation by psychiatrist Matthew Carroll both concluded that Loughner isn't fit for trial because he cannot assist in his defense due to mental illness. Both evaluations were recorded, but they weren't shown in court.

Burns said he agreed with Carroll's evaluation that said Loughner is "clearly illogical and confused." The judge said Loughner wasn't masquerading a mental illness and noted that he had been acting bizarrely for the past two years.

The judge also said that Loughner doesn't like being labeled mentally ill. "He scoffs at the idea," Burns said.

Loughner, 22, of Tucson, Arizona, has no rational understanding, an "irrational distrust of his lawyers" and "has delusions that prohibit him from considering legal defenses," the judge said.

The U.S. attorney general will take custody of Loughner for a period not to exceed four months, during which he will be taken to a hospital for further evaluation to determine if he will become competent to stand trial. Prosecutors said Loughner could be readied for competency through proper medication, and this practice has proved successful in other cases.

The next court date for Loughner is scheduled for September 21. He has pleaded not guilty to the 49 charges he faces, including murder and attempted murder, related to the January 8 mass shooting in a grocery store parking lot in Tucson.

He is accused of killing six people and wounding 13, including Giffords, an Arizona Democrat, who was holding a meet-and-greet with constituents at the time. Authorities say Giffords was the target of the attack.

Giffords' office declined to comment on Wednesday's ruling.

During his hearing, two marshals forcibly removed Loughner from the courtroom after an outburst in which one reporter heard him say, "Thank you for the freak show. She died right in front of me," and "You're changing ..."

Loughner's parents, seated in the courtroom, were clearly upset.

After a 15-minute recess, Burns asked Loughner if he wanted to watch the remainder of the proceedings on a television monitor. Loughner said yes, and he was removed from the courtroom.

Loughner entered the courtroom Wednesday no longer bald and clean-shaven, as he was depicted in his mugshot shortly after the shootings. He now has a full head of hair, along with facial hair.

He is accused of killing John M. Roll, a federal district judge; Gabriel M. Zimmerman, a staff member for Giffords; Dorothy J. Morris; Phyllis C. Schneck; Dorwan C. Stoddard; and 9-year-old Christina Taylor Green.

Giffords, shot through the head and brain, is recovering from surgery that implanted a synthetic bone and a shunt in her skull, her doctors said last week.

She was in attendance last week when the space shuttle Endeavour was launched with her husband, astronaut Mark Kelly, in command for a 16-day mission.

NASA spokeswoman Kylie Clem said Wednesday she was unsure whether Kelly would be informed of the Loughner ruling and, if so, in what manner. She said there are forms of communication that allow private conversations, such as between crew members and their families.

Among those attending Wednesday's hearing was Susan Hileman, 58, who was wounded in the shooting, and her husband, Bill. Susan Hileman brought Christina Green to the supermarket to meet Giffords.

Christina has often been remembered as the child victim who was born on September 11, 2001.

Also attending were friends and co-workers of Judge Roll, whose courtroom was in the same courthouse as Wednesday's hearing, and Mavy Stoddard, 75, who was wounded in the attack and whose husband, Dorwan, 76, a retired construction worker, died trying to shield his wife from the bullets.

CNN's Ted Rowlands reported from Tucson and CNN's Michael Martinez contributed from Los Angeles. CNN's Michael Cary contributed to this report.