The United States Supreme Court ruled Monday that a landmark civil rights law protects gay, lesbian and transgender workers from discrimination in employment.

In a resounding victory for LGBTQ rights from a conservative court, it 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 gay, lesbian and transgender workers. The opinion was written by Justice Neil Gorsuch and joined by Chief Justice John Roberts and the court’s four liberal justices.

The landmark ruling will extend protections to millions of workers nationwide and is a defeat for the Trump administration, which argued that Title VII of the Civil Rights Act that bars discrimination based on sex did not extend to claims of gender identity and sexual orientation.