(Reuters) - Screeners at U.S. airport security checkpoints should behave themselves, but cannot always be sued if they do not, according to a court ruling on Tuesday.

FILE PHOTO: Passengers scan their bags with Transportation Security Administration (TSA) employees at Terminal 4 of JFK airport in New York City, U.S., May 17, 2017. REUTERS/Joe Penney

A federal appeals court in Philadelphia threw out a First Amendment claim by an architect, Roger Vanderklok, who said he was arrested in retaliation for asking to file a complaint against an ill-tempered Transportation Security Administration supervisor.

“We, of course, do not suggest that TSA screeners should act with disdain for passenger rights or that they can escape all the consequences of their bad behavior,” Circuit Judge Kent Jordan wrote for a three-judge panel.

“Ultimately, the role of the TSA in securing public safety is so significant that we ought not create a damages remedy in this context,” Jordan added. “The dangers associated with aircraft security are real and of high consequence.”

Airport security screening can be stressful. The decision was issued four weeks after the TSA announced tighter screening of electronic carry-on items, because of concern they could be used to conceal explosives.

Vanderklok said he was flying on Jan. 26, 2013 to Miami from Philadelphia International Airport to run a half-marathon when TSA personnel subjected his carry-on bag to extra screening, after x-rays showed a heart-monitoring watch stored in PVC pipe.

The TSA supervisor, Charles Kieser, said he summoned police after Vanderklok made a bomb threat.

Vanderklok denied doing so, and said Kieser retaliated for his having requested a complaint form to report the supervisor’s “rude” and “aggressive” behavior.

Prosecutors charged Vanderklok, a father of three then in his mid-50s, with threatening to place a bomb and making terroristic threats. He was acquitted after Kieser’s testimony did not match airport surveillance video.

Vanderklok then sued Kieser for damages for allegedly violating his constitutional rights to free speech and against malicious prosecution.

Addressing only the free speech claim, the appeals court said a lower court judge erred in letting Vanderklok pursue it.

Jordan said TSA personnel are on the front lines of securing U.S. airports and air traffic, a “crucial aspect of national security,” and the threat of damages could cause hesitation in making split-second decisions about suspicious passengers.

Vanderklok’s lawyer had no immediate comment. Kieser’s lawyer and the TSA did not immediately respond to requests for comment. Claims against several other defendants were previously dismissed.

The case is Vanderklok v Kieser, 3rd U.S. Circuit Court of Appeals, No. 16-3422.