On Monday, the Supreme Court ruled that an existing civil rights law protects workers from job discrimination on the basis of their sexual orientation.

The Associated Press reports that the court decided by a 6-3 vote that Title VII of the Civil Rights Act of 1964, which makes it illegal for employers to discriminate based on a person's sex and other factors, also covers sexual orientation. Some states have their own laws that prohibit job discrimination, while others only offer the same protection to public employees. As NBC News reports, those laws remain in place, but the ruling means that federal law now provides protection for LGBT workers across the country. 

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

The ruling was considered a victory for the likes of Gerald Bostock, who claimed he was terminated from his county job in Georgia in 2013 when he joined a gay softball team. The 11th U.S. Circuit Court of Appeals previously dismissed his claim, noting that "discharge for homosexuality is not prohibited by Title VII."

The Trump administration has argued with the court that Title VII does not consider sexual orientation, which stands in stark contract to the Obama administration's stance. "The ordinary meaning of 'sex' is biologically make or female; it does not include sexual orientation," the Justice Department added. "An employer who discriminates against employees in same-sex relationships thus does not violate Title VII as long as it treats men in same-sex relationships the same as women in same-sex relationships."

Monday's ruling comes just days after the Trump administration scrapped Obama-era healthcare protections for members of the LGBTQ community.