A federal judge has ruled that a Yemeni man arrested after attempting to break into the cockpit of a San Francisco-bound flight while screaming in Arabic is incompetent to stand trial.

SAN FRANCISCO -- A federal judge has ruled that a Yemeni man arrested after attempting to break into the cockpit of a San Francisco-bound flight while screaming in Arabic is incompetent to stand trial.

U.S. District Judge Jeffrey White on Thursday held that Rageh Almurisi, 28, was unable to aid in his own defense and ordered him to be hospitalized for the next four months for treatment for mental illness, the San Mateo County Times reported. Almurisi has previously pleaded not guilty to the charge of interfering with a flight crew, a crime that carries a penalty of up to 20 years in prison.

Almurisi was arrested May 9 after he marched toward the cockpit on a Chicago-to-San Francisco American Airlines flight before pounding on its door, while yelling "Allahu akbar." "Allahu akbar" means "God is great" in Arabic and was also shouted by some of the terrorist hijackers on 9/11.

Almurisi was tackled by a flight attendant before being subdued with the help of several passengers.

In court Thursday, Almurisi's attorney Chris Morales said that doctors believe his client suffers from schizophrenia or a related disorder.

According to the Times, the Yemeni national appeared in court Thursday dressed in red jail clothing. Almurisi was shackled and nodded several times, but did not speak at the hearing.

White scheduled a hearing for March 29 to determine if the treatment has restored Almurisi to competency or if he will require further hospitalization.

Almurisi's family told the Times they want him to be released into their care.

"If he stays in (custody) he will never, ever get better," Almurisi's 40-year-old cousin Mohamed Almurisi said. "We will take care of him."