The US Supreme Court has ruled that a landmark civil rights law protects gay, lesbian and transgender people from discrimination in employment.

The court decided by a 6-3 vote that a key provision of the Civil Rights Act of 1964 known as Title VII that bars job discrimination because of sex, among other reasons, encompasses bias against LGBT workers.

Justice Neil Gorsuch wrote for the court: “An employer who fires an individual for being homosexual or transgender fires that person for traits or actions it would not have questioned in members of a different sex. Sex plays a necessary and undisguisable role in the decision, exactly what Title VII forbids.”

Justices Samuel Alito, Brett Kavanaugh and Clarence Thomas dissented.

Members of the US Supreme CourtMembers of the US Supreme Court (AP/J. Scott Applewhite, File)

“The Court tries to convince readers that it is merely enforcing the terms of the statute, but that is preposterous,” Mr Alito wrote in the dissent. “Even as understood today, the concept of discrimination because of ‘sex’ is different from discrimination because of ‘sexual orientation’ or ‘gender identity.'”

Mr Kavanaugh wrote in a separate dissent that the court was rewriting the law to include gender identity and sexual orientation, a job that belongs to Congress. Still, Mr Kavanaugh said the decision represents an “important victory achieved today by gay and lesbian Americans”.

The outcome is expected to have a big impact for the estimated 8.1 million LGBT workers across the country because most states do not protect them from workplace discrimination. An estimated 11.3 million LGBT people live in the US, according to the Williams Institute at the UCLA law school.

But the decision is not likely to be the court’s last word on a host of issues revolving around LGBT rights, Mr Gorsuch noted.

Lawsuits are pending over transgender athletes’ participation in school sporting events, and courts also are dealing with cases about sex-segregated bathrooms and locker rooms, a subject that the justices seemed concerned about during arguments in October. Employers who have religious objections to employing LGBT people also might be able to raise those claims in a different case, Mr Gorsuch said.

“But none of these other laws are before us; we have not had the benefit of adversarial testing about the meaning of their terms, and we do not prejudge any such question today,” he wrote.

The cases were the court’s first on LGBT rights since Justice Anthony Kennedy’s retirement and replacement by Mr Kavanaugh. Mr Kennedy was a voice for gay rights and the author of the landmark ruling in 2015 that made same-sex marriage legal throughout the United States. Mr Kavanaugh generally is regarded as more conservative.

The Trump administration had changed course from the Obama administration, which supported LGBT workers in their discrimination claims under Title VII.