The JetBlue pilot who in March left the cockpit during a flight and began screaming at passengers has been found not guilty by reason of insanity.

U.S. District Judge Mary Lou Robinson of Texas made the ruling in favor of Clayton Osbon, 49, the Associated Press reported. In her decision, Robinson said that at the time, Osbon suffered "from a severe mental disease or defect that impaired his ability to appreciate the nature, quality, or wrongfulness of his behavior."

After a court-ordered psychiatric evaluation, Osbon was found mentally competent to stand trial. At the time, Judge Robinson said Osbon was "not now suffering from a mental disease or defect."

However, he will now be sent to a federal mental health facility in Fort Worth, Texas, for further evaluation.

Osbon's attorney, Dean Roper, declined to comment on the ruling. Another hearing is scheduled for Osbon on August 6, during which a judge will decide whether the former pilot should be released or sent to a mental health facility.

In April, Osbon was released from a hospital and appeared in court, where he was indicted on one charge of interfering with a flight crew after the March 27 incident. During the flight from New York to Las Vegas, Osbon allegedly shouted incoherent statements at passengers, citing both al-Qaida and Jesus Christ. Witnesses say Osbon had to be wrestled to the floor before the plane could land safely.

Before beginning his tirade, Osbon reportedly said to the flight crew, "We're not going to Vegas," and told the first officer, "We're going to have to take a leap of faith."

Had he been convicted, Osbon could have faced 20 years in prison, Reuters reported.

JetBlue spokeswoman Alison Croyle said Tuesday that the airline "continues to support the Osbon family; we don't have further comment as we let the judicial process play out. We can confirm he is still employed, on inactive status, with JetBlue," she said.