The decision said Title VII of the Civil Rights Act of 1964, which makes it illegal for employers to discriminate because of a person’s sex, also covers sexual orientation and transgender status.

The U.S. Supreme Court ruled Monday that existing federal law forbids job discrimination on the basis of sexual orientation or transgender status, a major victory for advocates of gay rights and for the nascent transgender rights movement — and a surprising one from an increasingly conservative court.

By a vote of 6-3, the court said Title VII of the Civil Rights Act of 1964, which makes it illegal for employers to discriminate because of a person’s sex, among other factors, also covers sexual orientation and transgender status. It upheld rulings from lower courts that said sexual orientation discrimination was a form of sex discrimination.

Equally surprising was that the decision was written by President Donald Trump‘s first Supreme Court appointee, Neil Gorsuch, who was joined by Chief Justice John Roberts and the court’s four more liberal members to form a majority.

“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,” Gorsuch wrote for the court. “Sex plays a necessary and undisguisable role in the decision, exactly what Title VII forbids.”

“Those who adopted the Civil Rights Act might not have anticipated their work would lead to this particular result,” he wrote, adding, “But the limits of the drafters’ imagination supply no reason to ignore the law’s demands.”

The Trump administration had urged the court to rule that Title VII does not cover cases like these, in a reversal from the position the government took during the Obama administration.

Across the nation, 21 states have their own laws prohibiting job discrimination based on sexual orientation or gender identity. Seven more provide that protection only to public employees. Those laws remain in force, but Monday’s ruling means federal law now provides similar protection for LGBTQ employees in the rest of the country.

Spread The Love! @CountzPR on Facebook, Twitter and Instagram