The US Justice Department on Wednesday argued in a major federal lawsuit that a 1964 civil rights law doesn’t protect gay workers from discrimination, thereby diverging from a separate, autonomous federal agency that had supported the gay plaintiff’s case.

The Trump administration’s filing is unusual in part because the Justice Department isn’t a party in the case, and the department doesn’t typically weigh in on private employment lawsuits.

But in an amicus brief filed at the US Court of Appeals for the 2nd Circuit, lawyers under Attorney General Jeff Sessions contend that Title VII of the Civil Rights Act of 1964, which bans sex discrimination, does not cover sexual orientation.

"The sole question here is whether, as a matter of law, Title VII reaches sexual orientation discrimination," says the Justice Department's brief. "It does not, as has been settled for decades. Any efforts to amend Title VII’s scope should be directed to Congress rather than the courts."

The Justice Department also contends that Title VII only applies if men and women are treated unequally.

"The essential element of sex discrimination under Title VII is that employees of one sex must be treated worse than similarly situated employees of the other sex, and sexual orientation discrimination simply does not have that effect," the brief says.

"Any efforts to amend Title VII’s scope should be directed to Congress rather than the courts."

The case kicked off in 2010 when Donald Zarda, a skydiving instructor, filed suit against his employer in federal court in New York, alleging the company terminated him for his sexual orientation in violation of Title VII.

After a lower court ruled and the case was appealed, the 2nd Circuit invited outside parties to weigh in. Zarda v. Altitude Express is now before before a full panel of judges at the court.

Among Zarda’s boosters is the Equal Employment Opportunity Commission, a largely autonomous federal agency that handles civil rights disputes in the workplace, which supported Zarda last month in its own court filing.

For several years, the EEOC has declared in federal court that Title VII bans anti-gay discrimination, saying it is based on sex stereotyping, and therefore discrimination on the basis of sex.

But the Justice Department argues in its latest brief, "the EEOC is not speaking for the United States and its position about the scope of Title VII is entitled to no deference beyond its power to persuade."

The scope of Title VII has been disputed for years.

Under President Obama, the government argued Title VII's ban on sex discrimination also included gender identity — thereby barring discrimination against transgender workers. But the Obama administration never went as far to say the civil rights law also covered sexual orientation. It had in fact opposed the argument, claiming that its hands were tied by prior court precedent. Yet in 2016, the Obama administration arguably dialed back its opposition by not trying to dismiss a case brought on those grounds.

If Zarda’s argument were to prevail — despite his death in a base-jumping accident in 2014 — it would set new precedent in the circuit by overturning two cases from the 2000s.

Further, it would give momentum to the argument as a general matter, given that in April the 7th Circuit ruled in favor of a lesbian who made the same claim.

Under Sessions, the Justice Department has pushed back against the EEOC's view and that court decision. "The theories advanced by the EEOC and the Seventh Circuit lack merit," the brief on Wednesday said. "These theories are inconsistent with Congress’s clear ratification of the overwhelming judicial consensus that Title VII does not prohibit sexual orientation discrimination."

Several LGBT activists had worried the Justice Department would unleash a more sweeping claim that gender-identity discrimination isn't covered under the Title VII as well — but the brief doesn't explicitly speak to that issue.

Earlier on Wednesday, President Trump announced he would end all transgender military service.

“On the day that will go down in history as Anti-LGBT Day comes one more gratuitous and extraordinary attack on LGBT people’s civil rights," said a statement from James Esseks, director of the American Civil Liberties Union's LGBT & HIV Project. "The Sessions-led Justice Department and the Trump administration are actively working to expose people to discrimination."

“Fortunately, courts will decide whether the Civil Rights Act protects LGBT people, not an Attorney General and a White House that are hell-bent on playing politics with people's lives," he said.