Get breaking news alerts and special reports. The news and stories that matter, delivered weekday mornings.

WASHINGTON — The Justice Department told an appeals court this week that federal civil rights law does not ban discrimination on the basis of sexual orientation.

It's another big setback for the LGBT community, a group that candidate Donald Trump pledged to support when he held up a rainbow flag at 2016 rally in Colorado.

The government's court filing comes in a discrimination lawsuit against a New York skydiving company. One of its instructors, Donald Zarda, said he was fired for being gay.

He claimed the firing violated the Civil Rights Act, which, among other things, bans discrimination "because of sex." The Equal Employment Opportunity Commission agreed. "Discrimination because of sexual orientation cannot rationally be distinguished from discrimination because of sex," the EEOC said.

Let our news meet your inbox. The news and stories that matters, delivered weekday mornings. This site is protected by recaptcha

But the Justice Department unexpectedly stepped into that case Wednesday, even though the government was not involved in the dispute, to say the law applies only to discrimination that treats men and women differently.

While there have been "notable changes in societal and cultural attitudes about discrimination," the government said, Congress has consistently declined to amend the law in light of those changes.

The Justice Department's position was consistent with the way most federal appeals courts have ruled on the issue, but it marked a turnaround from the approach taken during the Obama administration.

The Justice Department brief, filed in the Second Circuit Federal Court of Appeals in New York, came the same day the president said transgender people cannot serve in the U.S. military.

"I think the community feels very much under attack and under siege by this administration. In a very real sense, it was the administration's anti-LGBT day," said James Esseks of the American Civil Liberties Union.

But some conservative groups welcomed the Justice Department’s action. “Only Congress can amend the federal law, and that diverse body of legislators has rejected several requests to do so. I applaud the DOJ for upholding the rule of law," said Mat Staver of Liberty Counsel.

Caught off guard by the President's tweets on transgender military service, the Pentagon is trying to work out what it means.

In a memo Wednesday to all commanders, Marine Corps Gen. Joseph Dunford, chairman of the Joint Chiefs of Staff, said there will be no modifications to the current policy until the president's directive is made formal. For now, he said, "we will continue to treat all of our personnel with respect."

The spells uncertainty for transgender service members like Mia Mia Mason, after five tours in Iraq and Afghanistan.

"It's very costly for me. I could lose my health care. I lose my pension. And those are things that I've earned for the 18 years I've served."