U.S. District Judge Mary Lou Robinson issued an order Wednesday requiring the Jet Blue JetBlue Airways captain accused of interfering with a flight crew, when he disrupted a Las Vegas-bound flight, after he left the cockpit and screamed about religion and terrorists, according to Yahoo News.

The signed order by the federal judge in Amarillo, TX sends Clayton Osbon, 49, to a medical facility for testing.

There doctor's will determine whether he was legally sane when JetBlue passengers wrestled him to the floor after witnesses said he ran through the cabin yelling about Jesus and al-Qaida.

This exam is crucial to his impending trial because it could determinative regarding his ability to stand trial.

The prosecution has in turn filed a motion asking the psychiatric physician to determine whether Osbon's actions cited in a FBI affidavit established " a likelihood that Osbon may be suffering from a mental disease or defect."

Additionally prosecutor, Christy Drake, filed a motion earlier this week to deny Osbon bond in order to assure the "safety of any other person and the community," and that he should remain in custody because he committed a violent crime.

After Osbon's unexpected outburst on-board the JetBlue flight passengers were forced to restrain him with seat belt extenders and zip tie handcuffs for about 20 minutes until the plane landed safely.

After the plane made an emergency landing in Amarillo, he was taken to a hospital for a psych evaluation on March 27.

The potential federal penalty for assaulting/intimidating the crew, interfering with its duties and diminishing its ability to operate the plane carries with it as much as 20 years in prison. So needless to say this mental evaluation has quite an impact on the majority of 49-year-old Osbon's life.

According to a federal investigation,  Osbon said "things just don't matter" to his co-pilot, incoherently rambled about religion, and his behavior became generally more erratic as he struggled with his co-captain and exited the cockpit.

Passengers on-board the flight said that Osbon seemed out of sorts as he expressed his concern regarding Middle Eastern threats after crew members tried to calm him down in the back of the plane.

One flight attendant's ribs were bruised while trying to restrain Osbon, but luckily no one on-board was seriously injured.

JetBlue immediately suspended Osbon.

As mentioned earlier, an insanity test will be crucial as to whether there will be a trial here. At first glance, it looks as if the pilot suffered from some mental defect as a result of his strange and unexpected outburst.

However, judges are often times skeptical of a legal insanity defense requiring that the defendant prove not only that the he suffered from a mental disease/defect, but also that the disease/defect directly caused the defendant to commit the crime in question.

In addition, not any and all mental deficiencies satisfy the legal insanity test. Accordingly, it will be interesting to see the what the psychiatric tests reveal and whether they are enough to establish Osbon's affirmative defense.