A federal appeals court on Monday ruled that a 1964 civil rights law bans anti-gay workplace discrimination. The decision rebukes the Trump administration — which had argued against a gay worker in the case — and hands progressives a win in their strategy to protect LGBT employees with a drumbeat of lawsuits.

The dispute hinges on whether Title VII of the Civil Rights Act of 1964, which bans discrimination on the basis of sex, also bans workplace discrimination due to sexual orientation.

The Court of Appeals for the 2nd Circuit ruled Monday, “We now hold that sexual orientation discrimination constitutes a form of discrimination ‘because of . . . sex,’ in violation of Title VII.” In doing so, the court overruled a lower court — and a precedent from two previous court cases — and remanded the case to be litigated in light of their reading of Title VII.

The decision holds national implications due to its high tier in the judicial system, and because it’s seen as a litmus test of the Trump administration’s ability — or inability — to curb LGBT rights through court activism. The Justice Department had injected itself into the case even though it wasn’t a party to the lawsuit and doesn’t normally involve itself in private employment disputes.

The case was heard in New York City by all 13 judges in the 2nd Circuit, known as an en banc hearing, which leaves the Supreme Court as the only avenue for a potential appeal.

The ruling comes soon after another major gay-rights ruling in 2017, thereby giving momentum to the argument that anti-gay discrimination is prohibited even without a federal law that explicitly says so.

"Sexual orientation is a function of sex and, by extension, sexual orientation discrimination is a subset of sex discrimination," the majority wrote.

In reaching its decision Monday, the court pointed out that anti-gay discrimination would not exist "but for" a person's sex. That is to say, gays, lesbians, and bisexuals would not experience this type of unequal treatment had they been born a different gender, or were attracted to a different sex.

"A woman who is subject to an adverse employment action because she is attracted to women would have been treated differently if she had been a man who was attracted to women," the majority wrote in an opinion led by Judge Robert Katzmann. "We can therefore conclude that sexual orientation is a function of sex and, by extension, sexual orientation discrimination is a subset of sex discrimination."

Although no federal law directly bans anti-LGBT discrimination in workplaces, in 2010, Donald Zarda sued his employer, Altitude Express, Inc., alleging the company terminated him for his sexual orientation in violation of Title VII.

That position has been adopted by the Equal Employment Opportunity Commission, a largely autonomous federal agency that handles civil rights disputes in the workplace and supported Zarda in court.

An EEOC lawyer told the judges at a September hearing in Manhattan, “Sex stereotyping says that if you are a man attracted to a man, or a woman attracted to a woman, you’re not behaving the way those genders are supposed to behave.”

“There is a common-sense difference between sex discrimination and sexual orientation discrimination,” a Justice Department attorney told the court in September, arguing that Congress could have clarified the law but didn’t.

The discord between agencies stems from the Trump administration turning away from the Obama administration’s LGBT-friendly trajectory, thereby letting lawyers under US Attorney General Jeff Sessions clash with more autonomous corners of the federal bureaucracy.

Under Sessions, the Justice Department has tried to roll back several LGBT gains, rescinding Obama-era policy that protects transgender students and reversing a policy that said Title VII protects transgender workers. Sessions also filed a brief at the Supreme Court in favor of a Christian baker who refused a wedding cake to a gay couple, and in Zarda’s case, argued Title VII also doesn’t encompass sexual orientation.

A dissenting judge countered that Congress "did not then prohibit, and alas has not since prohibited, discrimination based on sexual orientation."

The Obama administration had tried to skirt the issue of whether Title VII covered gay workers. In 2012, the administration sought to dismiss a sexual orientation lawsuit based on Title VII by saying a plaintiff failed to prove the facts to support the sex-stereotyping claim. In 2016, the Obama administration arguably dialed back its position when it didn’t even try to dismiss a similar lawsuit.

On Monday, the 2nd Circuit found "sexual orientation is doubly delineated by sex because it is a function of both a person’s sex and the sex of those to whom he or she is attracted. Logically, because sexual orientation is a function of sex and sex is a protected characteristic under Title VII, it follows that sexual orientation is also protected."

But in a 74-page dissent, Judge Gerard Lynch wrote that Congress had not intended to outlaw anti-gay discrimination when it approved Title VII's language in 1964. And in contrast to dozens of states that have explicitly passed laws banning anti-LGBT workplace discrimination, he argued Congress "has not done so yet."

Lynch wrote that Title VII "was intended to secure the rights of women to equal protection in employment" and that Congress "did not then prohibit, and alas has not since prohibited, discrimination based on sexual orientation."

Likewise, Justice Department spokesperson Devin O'Malley, in a statement to BuzzFeed News, made an argument that the majority overstepped Congress's intent when it enacted Title VII.

"We remain committed to the fundamental principle that the courts cannot expand the law beyond what Congress has provided," O'Malley said. "The position that the Department advocated in this case has been its longstanding position across Administrations and remains the law of nine different Courts of Appeals.

But Judge Raymond Lohier rebutted that thinking in a concurring opinion, saying that Judge Lynch was misguided to speculate on Congress's intent.

"Time and time again," Lohier wrote, "the Supreme Court has told us that the cart of legislative history is pulled by the plain text, not the other way around. The text here pulls in one direction, namely, that sex includes sexual orientation."

Courts seem a ways off from resolving Title VII’s scope on LGBT issues. In April 2017, the 7th Circuit Court of Appeals ruled in favor of a lesbian who made the same claim that she was protected by Title VII. But in December, the Supreme Court declined to hear a challenge from 11th Circuit, which said Title VII does not cover gay workers.

CORRECTION

Feb. 26, 2018, at 18:04 PM

Judge Robert Katzmann's name was misspelled in an earlier version of this post.