NEW YORK (AP) — Ruling in the case of a gay skydiving instructor, a federal appeals court in New York on Monday became the second one in the country to declare that U.S. anti-discrimination law protects employees from being fired over their sexual orientation.

The decision could set the stage for an appeal to the U.S. Supreme Court to settle the question once and for all.

In a 10-3 ruling, the 2nd U.S. Circuit Court of Appeals said that while it and other courts around the U.S. previously found that Title VII of the 1964 Civil Rights Act didn’t cover sexual orientation, “legal doctrine evolves.”

“We now conclude that sexual orientation discrimination is motivated, at least in part, by sex and is thus a subset of sex discrimination,” Chief Judge Robert A. Katzmann said, writing for the majority.

The decision involved Donald Zarda, who was fired in 2010 from a skydiving job in Central Islip, New York, that required him to strap himself tightly to clients so they could jump in tandem from an airplane. To put one female student at ease about the physical contact, he said, he told her not to worry — he was gay. The school fired Zarda after the woman’s boyfriend called to complain.

The woman alleged Zarda inappropriately touched her and disclosed his sexual orientation to excuse his behavior. The skydiving company maintained that it was Zarda’s behavior, not his sexuality, that led to his firing.

The ruling applies only in the 2nd Circuit, which consists of New York, Connecticut and Vermont. But it could wind up before the Supreme Court, which declined in December to hear the case of a Georgia woman who had also argued she was fired for being gay.

Title VII bars employment discrimination on the basis of “race, color, religion, sex or national origin.” The 7th U.S. Circuit Court of Appeals in Chicago last year also concluded “discrimination on the basis of sexual orientation is a form of sex discrimination.”

Saul Zabell, the lawyer for the skydiving company, said his clients were “extremely proud” of the court for saying that sexual orientation is covered by federal antidiscrimination law and for “curing this glaring legislative gap in fundamental human rights.”

But he said his clients were disappointed the court had “ignored the facts of the underlying matter.” He would not say whether the company would appeal.

Zarda died three years ago in a wingsuit accident in Switzerland.

His sister, Melissa Zarda, said by telephone from Kansas City, Missouri, that her brother “would have been just over the moon, beyond excited,” with the ruling.

Gay rights organizations welcomed the decision.

“Today’s ruling is the latest victory affirming that employees should be evaluated only on their work ethic and job performance — not on who they are or who they love,” Masen Davis, chief executive of Freedom for All Americans, said in a statement.

One of the three dissenting judges, Gerald E. Lynch, said Congress never intended Title VII to cover sexual orientation, though he added: “I would be delighted to awake one morning and learn Congress had just passed legislation adding sexual orientation to the list of grounds of employment discrimination prohibited under Title VII.”

The case led to two government agencies offering opposing views. The Equal Employment Opportunity Commission said Title VII applies to sexual orientation. The U.S. Justice Department argued it does not.

“We remain committed to the fundamental principle that the courts cannot expand the law beyond what Congress has provided,” Justice Department spokesman Devin O’Malley said. But he the department will continue to enforce numerous other laws Congress enacted to prohibit discrimination based on sexual orientation.

The EEOC did not immediately comment.

Most federal appeals courts in the past have ruled that “sex” means biological gender, not sexual orientation.

During oral arguments in the cast last fall, one judge suggested the Justice Department changed its position after President Donald Trump was elected. The department filed its legal arguments the same day Trump announced on Twitter that transgender people could no longer serve in the military.