A US federal court has ruled to protect gay employees in the workplace.

The Manhattan court overruled prior decisions that said the opposite, saying "legal doctrine evolves".

The 10-3 ruling by the 2nd US Circuit Court of Appeals was made after an openly gay skydiving instructor was fired for admitting his sexuality.

President Trump's Justice Department previously said that Title VII of the Civil Rights Act of 1964 did not cover sexual orientation.

The Equal Employment Opportunity Commission has argued that Title VII, which prohibits workplace discrimination based on race, colour, religion, sex or national origin, should also protect employees from being discriminated against based on sexual orientation.

The majority of the Manhattan court agreed, though three 2nd Circuit Court judges dissented.

The court had previously ruled in 2000 and 2005 that sexual orientation was not covered under "sex" because it was not a biological gender.

Chief Judge Robert A Katzmann said in a statement about the ruling: "We now conclude that sexual orientation discrimination is motivated, at least in part, by sex and is thus a subset of sex discrimination."

The ruling only applies to the 2nd Circuit Court's jurisdiction, which covers the states of New York, Vermont and Connecticut.

Unlike other identities, sexual orientation is not visible from the outside, and has led to countless controversial decisions including the military's overturned "don't ask don't tell" 1994 law which allowed gay service members to serve, so long as they kept their sexuality a secret.

In the case of the former Altitude Express skydive instructor Donald Zarda, he consoled a visibly nervous female customer who he was strapping into the skydive suit not to worry about their close physical contact because he was "100% gay".

The woman later told her boyfriend about the encounter who complained to the skydive school, resulting in Mr Zarda's dismissal from the company in 2010.

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

Government agencies took opposing sides in the case.

While the Equal Employment Opportunity Commission argued for protections against employees for sexual orientation, the Trump Justice Department contends that the law does not apply to sexual orientation.

They insisted that the Equal Employment Opportunity Commission was "not speaking for the United States".

This is the second similar ruling by a federal court, though other courts have ruled against protections for gay employees.

The differing opinions of the lower courts could lead the US Supreme Court to take up the case.