(In this July 27 story, corrects paragraph 7 to reflect that Zarda died in a BASE-jumping accident, not a skydiving accident)

Slideshow ( 2 images )

(Reuters) - The Trump administration told a U.S. appeals court that federal law does not ban discrimination against gay employees, a sharp reversal of the position former President Barack Obama took on a key civil rights issue.

The U.S. Department of Justice, in a friend of the court brief, told the 2nd U.S. Circuit Court of Appeals in Manhattan on Wednesday that Congress never intended Title VII, which bans sex discrimination in the workplace, to apply to gay workers.

The department also said the court owed no deference to the U.S. Equal Employment Opportunity Commission, a federal agency that enforces Title VII and has argued since 2012 that the law bans discrimination on the basis of sexual orientation.

The brief came hours after President Donald Trump said he would ban transgender people from serving in the military. That would reverse a 2016 policy adopted by Obama.

Justice Department spokesman Devin O’Malley said the brief was consistent with rulings by 10 federal appeals courts and “reaffirms the Department’s fundamental belief that the courts cannot expand the law beyond what Congress has provided.”

The department’s brief was in support of New York skydiving company Altitude Express Inc in a lawsuit filed by a former employee, Donald Zarda.

Zarda claimed he lost his job as a skydiving instructor after he told a customer he was gay and she complained. He died in a BASE-jumping accident after filing the lawsuit.

In April, a three-judge 2nd Circuit panel dismissed Zarda’s case, citing a prior ruling that said discrimination against gay workers is not a form of sex discrimination under Title VII.

The full court, which can overturn the prior decision, agreed in May to review the case.

The issue could reach the U.S. Supreme Court in a different case brought by a former security guard at a Georgia hospital who claims she was harassed and forced to quit because she is gay.

Earlier this month, LGBT rights group Lambda Legal, which represents the former security guard, said it would ask the high court to review the case.

On Wednesday, the Justice Department said employers engage in sex discrimination only when they treat male and female workers differently. Objecting to homosexuality does not depend on sex, the department said, but on moral or religious beliefs.

“Of course, if an employer fired only gay men but not gay women (or vice versa), that would be prohibited by Title VII,” the department wrote, “but precisely because it would be discrimination based on sex, not sexual orientation.”

Zarda’s lawyer, Gregory Antollino, said on Thursday that the department was making the same arguments the Supreme Court rejected in cases involving discrimination against workers in interracial relationships.