(Reuters) - Interfering with a flight crew is not always a “crime of violence,” a federal appeals court ruled on Wednesday in a decision favoring a New York man who rushed the cockpit and shouted about jihad while aboard a United Airlines flight.

The 4th U.S. Circuit Court of Appeals in Richmond, Virginia, ordered a lower court judge to reconsider whether David Diaz should pay $22,151.77 in restitution to United as part of a punishment that also included nine months in prison.

Diaz, 38, had pleaded guilty to interfering with the crew of a late night United flight to Denver from Dulles International Airport outside Washington, D.C. on March 16, 2015.

Prosecutors said the Poughkeepsie, New York, resident had been drinking prior to yelling about “jihad” and there being something in the belly of the plane. Passengers and the flight crew eventually restrained him and the plane returned to Dulles.

In ordering restitution, U.S. District Judge Anthony Trenga in Alexandria, Virginia, rejected Diaz’s claim that the crime was covered by the Victim and Witness Protection Act (VWPA), under which restitution is discretionary, rather than another law mandating restitution.

In Wednesday’s 3-0 decision, Circuit Judge Henry Floyd said flight crew interference that violates federal law “criminalizes forcible touching.”

But he said that cannot “categorically” be deemed a crime of violence under a Supreme Court precedent requiring that such a crime include force capable of causing physical pain or injury.

As a result, Diaz was not covered by the law mandating restitution, and Trenga should review his ability to pay under the VWPA before imposing restitution, the appeals court said.

Patrick Bryant, a federal public defender representing Diaz, said he was pleased with the decision.

The office of U.S. Attorney Dana Boente in Alexandria did not immediately respond to requests for comment.

Diaz completed his prison term last Dec. 16 and remains subject to supervised release, federal records show.

The case is U.S. v. Diaz, 4th U.S. Circuit Court of Appeals, No. 16-4226.