Labor and LGBTQ rights advocates celebrated on June 15 after the U.S. Supreme Court ruled that job discrimination on the basis of sexual orientation or identity is prohibited under long-standing federal law.

The ruling, handed down by Trump appointee Justice Neil Gorsuch, is a rebuke to the White House, which argued Title VII of the Civil Rights Act of 1964 does not cover sexual orientation and that “the ordinary meaning of ‘sex’ is biologically make or female.”

The court ruled in a 6-3 decision that the law makes it illegal for employers to discriminate against a worker because of their transgender status and their sexual orientation, in addition to their sex assigned at birth.

“An employer who fired 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,” wrote Gorsuch. “Those who adopted the Civil Rights Act might not have anticipated their work would lead to this particular result, but the limits of the drafters’ imagination supply no reason to ignore the law’s demands.”

“Only the written word is the law, and all persons are entitled to its benefit,” he added.

Gorsuch and Chief Justice John Roberts, both appointed by Republicans, joined the four liberal-leaning justices on the high court in the ruling.

The ACLU, which represented two plaintiffs in the Supreme Court case, gave credit to the victory to countless LGBTQ Americans who fought over the past five decades for equality in the workplace.

“This is a huge victory for LGBTQ equality,” said James Esseks, director of the ACLU’s LGBTQ & HIV Project. “Over 50 years ago, Black and Brown trans women, drag queens, and butch lesbians fought back against police brutality and discrimination that too many LGBTQ people still face. The Supreme Court’s clarification that it’s unlawful to fire people because they’re LGBTQ is the result of decades of advocates fighting for our rights.”

“The court has caught up to the majority of our country, which already knows that discriminating against LGBTQ people is both unfair and against the law,” Esseks added, referring to 28 states which already protect LGBTQ employees from discrimination.

The ruling comes a month after the death of Aimee Stephens, a woman who was fired from her job at a funeral home after telling her employer she was transgender.

“For the last seven years of Aimee’s life, she rose as a leader who fought against discrimination against transgender people, starting when she was fired for coming out as a woman, despite her recent promotion at the time,” said Donna Stephens, Aimee’s wife. “I am grateful for this victory to honor the legacy of Aimee, and to ensure people are treated fairly regardless of their sexual orientation or gender identity.”

The ruling was handed down a day after thousands of people across the country rallied for the rights of black transgender Americans following the killings of two black trans women in the past week.

“It’s worth noting that employment, perhaps more than anything, is a concrete predictor of the safety of Black trans women in this country,” tweeted journalist Kate Sosin as the nation awaited the Supreme Court’s ruling.

Advocates noted on Monday that the LGBTQ community still faces a fight to secure full civil rights.

“Our work is not done. There are still alarming gaps in federal civil rights laws that leave people—particularly Black and Brown LGBTQ people—open to discrimination in businesses open to the public and taxpayer-funded programs,” said Esseks. “Congress must affirm today’s decision and update our laws to ensure comprehensive and explicit protections for LGBTQ people and all people who face discrimination.”

The U.S. also has work to do to protect all LGBTQ people from unjust treatment in all public spaces, added GLBTQ Legal Advocates & Defenders (GLAD).

“Our federal and many state laws still leave too many LGBTQ people and others unprotected in critical areas of life including access to public places like stores or public transportation, or in federally funded vital social services,” said Mary Bonauto, Civil Rights Project director for GLAD. “Today’s ruling also arrives against the backdrop of pervasive systemic racism and racist violence, that imposes incalculable and intolerable costs on Black Americans and all people of color, including those who are LGBTQ.”

Amnesty International expressed hope that the Supreme Court’s decision would resonate with lawmakers throughout the country and represent a major step toward full recognition of equal rights.

“No one should be afraid to be who they are in order to work or live their lives,” said Tarah Demant, director of the group’s Gender, Sexuality, and Identity Program. “LGBTQI people have a right to the same protections as everyone else, and they deserve to be able to live their lives without fear of discrimination—something the Supreme Court has affirmed today.”