AMARILLO, Texas — A federal judge in Texas found a JetBlue Airways pilot who left the cockpit during a flight and screamed about religion and terrorists not guilty by reason of insanity Tuesday.

U.S. District Judge Mary Lou Robinson in Amarillo issued the ruling during a bench trial for Clayton F. Osbon, noting he suffered from a “severe mental disease or defect.” Osbon’s attorney, Dean Roper, declined to comment.

Osbon, who recently was found mentally competent to stand trial after a court-ordered psychiatric evaluation, will be sent to a federal mental health facility for further examination until another hearing on or before Aug. 6. The judge will decide then whether he can be released or should be committed to a mental facility.

Osbon was indicted on one charge of interfering with a flight crew after the March 27 incident on a flight from Las Vegas to New York. Passengers say they wrestled him to the floor after he ran through the plane’s cabin yelling.

Next month’s hearing puts the burden on Osbon to show “by clear and convincing evidence” that his release would not pose future danger, according to the court records.

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.

The pilot’s wife, Connye Osbon, issued a statement in April saying the in-flight outburst “wasn’t intentionally violent toward anyone” and asked the media to respect her family’s privacy.

According to court documents, the plane was in midair when Osbon eerily told his first officer they wouldn’t make it to their destination.

Osbon started rambling about religion.

He scolded air traffic controllers to quiet down, then turned off the radios altogether and dimmed the monitors in the cockpit.

The first officer then “became really worried,” according to a sworn affidavit from FBI agent John Whitworth. “Osbon started trying to correlate completely unrelated numbers like different radio frequencies, and he talked about sins in Las Vegas.”

Osbon then left the cockpit and tensions on the plane began to escalate, according to witness accounts compiled by investigators.

From inside the locked cockpit, the co-pilot gave an order through the intercom to restrain Osbon, the affidavit said.

Passengers wrestled Osbon to the ground.