In a landmark decision, the Supreme Court ruled 6-3 on Monday that workplace discrimination on the basis of sexual orientation or gender identity is illegal under the Civil Rights Act of 1964.

Trump-appointed Justice Neil Gorsuch wrote the majority opinion with Chief Justice John Roberts and Justices Ruth Bader Ginsburg, Stephen Breyer, Sonia Sotomayor and Elena Kagan joining.

The case pertained to interpreting Title VII of the Civil Rights Act of 1964, which blocks employment discrimination based on race, religion, national origin and sex. The justices had to determine whether discrimination on the basis of sex included sexual orientation and gender identity.

“If the employer intentionally relies in part on an individual employee’s sex when deciding to discharge the employee—put differently, if changing the employee’s sex would have yielded a different choice by the employer—a statutory violation has occurred,” Gorsuch wrote in the majority opinion. “Title VII’s message is “simple but momentous”: An individual employee’s sex is ‘not relevant to the selection, evaluation, or compensation of employees.’ Price Waterhouse v. Hopkins, 490 U. S. 228, 239 (1989) (plurality opinion).”

He continues: “The statute’s message for our cases is equally simple and momentous: An individual’s homosexuality or transgender status is not relevant to employment decisions. That’s because it is impossible to discriminate against a person for being homosexual or transgender without discriminating against that individual based on sex.”

Justices Samuel Alito, Brett Kavanaugh and Clarence Thomas dissented, arguing that Congress, not SCOTUS, should create specific protections for the LGBT community.

The court considered two sets of cases: first a pair of lawsuits from gay men who said they were fired because of their sexual orientation and the second from a transgender woman who claimed her employer fired her after she announced her intention to dress as a woman at work.

The cases regarding gay rights are Bostock v. Clayton County, Ga., No. 17-1618, and Altitude Express Inc. v. Zarda, No. 17-1623.

In the first, Gerald Bostock, said he was fired from a government program helping abused children in Clayton County, Georgia after he joined a gay softball league. The second was brought by skydiving instructor, Donald Zarda, who was fired after he came out to a female customer worried about being strapped to him during a tandem dive.

Zarda’s estate is pursuing the case after he died in a 2014 skydiving accident.

The second set concerning transgender rights is R.G. & G.R. Harris Funeral Homes Inc. v. Equal Employment Opportunity Commission, No. 18-107.

Aimee Stephens was fired from a funeral home in Michigan after she told her employer she was transgender and would begin wearing women’s clothing to work.

Stephens, who has since passed away, had worked at the home for six years when she came out to her colleagues.

“What I must tell you is very difficult for me and is taking all the courage I can muster,” she wrote in a letter to her workplace in 2013. “I have felt imprisoned in a body that does not match my mind, and this has caused me great despair and loneliness.”

The home’s owner fired her two weeks later “because he was no longer going to represent himself as a man.”

The decision marks a big win for the LGBT community, offering some hope that Justice Anthony Kennedy‘s retirement in 2018 did not block their progress. Kennedy wrote the majority opinion for all four of the court’s major gay rights decisions. This is the first LGBT rights case to be heard by the court since his departure.

CORONAVIRUS FAQ: WIKI OF MOST FREQUENTLY ASKED QUESTIONS