In a victory for LGBTQ Americans, a federal appeals court delivered a blow to the Trump administration's Justice Department, ruling that the 1964 Civil Rights Act prohibits anti-gay discrimination in the workplace.

In its ruling on Zarda vs. Altitude Express, the Second Circuit Court of Appeals, covering New York, Connecticut, and Vermont, argued that "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. We can therefore conclude that sexual orientation is a function of sex and, by extension, sexual orientation discrimination is a subset of sex discrimination."

The Seventh Circuit Court reached a similar conclusion last year, becoming the first appeals court to argue that Title VII of the Civil Rights Act, which bars discrimination against employees based on "race, color, religion, sex, or national origin," should be understood to protect LGBTQ Americans.

"There have now been two federal appeals courts to recognize what we've always known—that discrimination based on sexual orientation is in fact discrimination, and that there is no room for it in the workplace," said Ria Tabacco Mar, staff attorney for the American Civil Liberties Union (ACLU), in a statement. "This decision is also a repudiation of the Trump administration's Justice Department, which has insisted that LGBT discrimination is acceptable under federal law."

The Trump administration, led by Attorney General Jeff Sessions, filed an amicus brief siding with the employer in the case of Zarda vs. Altitude Express. In the case, sky-diving instructor Donald Zarda alleged that he was fired due to his sexual orientation.

"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...Title VII's prohibition of sex discrimination does not encompass sexual orientation," wrote the Department of Justice.

While the decision only covers three states, it could signify an important shift in a country where the majority of states are not prohibited from workplace discrimination on the basis of sexual orientation.

"Today's opinion is a huge victory in the fight for equality and fairness for all LGBT workers," Greg Nevins, director of Lambda Legal's Employment Fairness Project, said in a statement. "We will continue pushing this issue until every LGBT person in this country benefits from the protection that our federal law provides by its plain terms against discrimination because of a person's sex, including their sexual orientation."