(Reuters) - A U.S. appeals court in Manhattan on Monday ruled that a federal law banning sex bias in the workplace also prohibits discrimination against gay employees, becoming only the second court to do so.

The 2nd U.S. Circuit Court of Appeals overruled prior decisions and said that a worker’s sex is necessarily a factor in discrimination based on sexual orientation.

The ruling went against a court brief filed by the Trump administration in 2017 that said Title VII of the Civil Rights Act of 1964 was not intended to provide protections to gay workers.

The 2nd Circuit revived a lawsuit by the estate of Donald Zarda, a former skydiving instructor on Long Island who said he was fired after he told a customer he was gay and she complained. Zarda’s estate was backed in the appeal by dozens of large companies, including Alphabet Inc’s Google, Microsoft Corp, CBS Corp and Viacom Inc.

Zarda died in a BASE-jumping accident after the lawsuit was filed.

Zarda’s former employer, Altitude Express Inc, and companies that have faced similar lawsuits have argued that when Congress adopted Title VII more than 50 years ago, it did not consider whether the law’s ban on sex bias included discrimination based on sexual orientation.

But lesbian, bisexual, gay and transgender groups and the federal Equal Employment Opportunity Commission have increasingly argued that sexual orientation is a function of a person’s gender.

The 2nd Circuit agreed on Monday in its 10-3 decision. Circuit Judge Robert Katzmann wrote that even though Congress had not sought to address gay bias in Title VII, laws “often go beyond the principal evil to cover reasonably comparable evils.”

Saul Zabell, a lawyer for Altitude Express, said he agreed with the ruling on Title VII. But he said Zarda did not face discrimination when he worked for the company.

Lawyers for Zarda’s estate did not respond to a request for comment.

New York Attorney General Eric Schneiderman, a Democrat who filed a court brief supporting Zarda, praised the decision in a statement.

“No employer should be able to penalize its employees because of who they love,” Schneiderman said.

Last April, the Chicago-based 7th U.S. Circuit became the first court to find that Title VII bans gay bias in the workplace.

The U.S. Supreme Court in December declined to take up a different case out of Georgia that posed the same question.