Robert MacLean exited the rarified air of the Supreme Court and walked down its 36 marble steps with the confidence of a cop who knows he’s right.

The tone of the questions and comments from the justices hearing his case provided ample reason for this former air marshal to feel good about the first Supreme Court case directly involving a federal whistleblower.

MacLean protected the public by alerting it to a 2003 Transportation Security Administration decision to save money by canceling air marshal assignments on long-haul flights that would require hotel stays. But the Supreme Court will decide whether TSA was legally justified in firing him.

When Ian H. Gershengorn, the deputy solicitor general, argued MacLean’s disclosures were prohibited by law, then acknowledged it was actually an agency rule, Justice Antonin Scalia interrupted: “So it is prohibited by regulations — let’s not play games.”

A little later, MacLean’s supporters where thrilled when Justice Sonia Sotomayor told his lawyer, Neal K. Katyal, “The facts are very much in your favor.”

MacLean and his lawyers know, however, that getting favorable comments from the justices and winning a case in the high court can be two different things. Depending on what the court says, a loss for MacLean could be a serious setback for federal whistleblowers generally. A broadly worded ruling against him could plunder the Whistleblower Protection Act. A narrowly worded ruling might apply only to the TSA.

“The survival” of a federal whistleblower protection law passed in 1978 is at stake, said Tom Devine, legal director for the nonprofit Government Accountability Project, which represents MacLean.

After the hearing, MacLean’s advocates looked forward to a ruling in his favor.

Mathew Tully, a partner in the Tully Rinckey law firm that filed briefs on behalf of MacLean, said he thought Gershengorn “got beat up pretty heavy by the judges” from the “whole range of ideologies.”

The Justice Department did not respond to a request for comment after the hearing.

A former Border Patrol agent who became an air marshal after the Sept. 11 terrorist attacks, MacLean questioned the TSA order through proper channels. Getting no satisfaction from agency officials, he told MSNBC about the order. Then TSA reversed its decision after the resulting uproar.

TSA should have thanked MacLean for preventing the agency from making a potentially disastrous mistake. Instead, it fired him in 2006 after discovering he was the whistleblower.

Even if the justices rule in his favor, MacLean’s fight for his job would continue. A favorable ruling by the court would send the case back to the Merit Systems Protection Board, which previously ruled against him, to decide whether MacLean had a reasonable belief that his disclosures would help prevent a serious risk to the public.

The Whistleblower Protection Act protects federal employees from being fired or retaliated against if they reasonably believe the situations they reveal could present “a substantial and specific danger to public health or safety.”

But the law does not protect them if the disclosures are “specifically prohibited by law.”

The Obama administration argues that the information MacLean revealed was prohibited by law. His lawyers say the relevant rule in the case is a regulation, not a law.

It’s worth noting that a bipartisan group of lawmakers, senators and House members, filed a brief supporting MacLean. Among them is Sen. Charles E. Grassley (R-Iowa), co-author and an original co-sponsor of the whistleblower law. Also noteworthy: It was not until 2006 that TSA declared the message MacLean revealed in 2003 to be sensitive security information. That sensitive information was delivered as an unsecured text message.

An analysis of the case for the American Bar Association, by Richard H. Seamon of the University of Idaho College of Law, said a victory for MacLean would “protect employees even if their disclosure violates agency rules, as long as the disclosures don’t violate the specific terms of a statute.”

“Even if MacLean wins,” Seamon wrote, “it will still take a brave employee to blow the whistle.”

Twitter: @JoeDavidsonWP

Previous columns by Joe Davidson are available at wapo.st/JoeDavidson.