The US Supreme Court has ruled that employers who fire workers for being gay or transgender are breaking the country's civil rights laws.
In a 6-3 decision it said federal law, which prohibits discrimination based on sex, should be understood to include sexual orientation.
The ruling is a major win for LGBT workers and their allies.
And it comes even though the court has grown more conservative.
"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," Judge Neil Gorsuch wrote, reports BBC.
Mr Gorsuch, who was nominated to the court by President Donald Trump, rejected the idea that the authors of the law had not intended such broad meaning.
"The limits of the drafters' imagination supply no reason to ignore the law's demands," he wrote.
Title VII of the Civil Rights Act of 1964 forbids employers from discriminating against employees on the basis of sex as well as gender, race, colour, national origin and religion.
The ruling resolves three cases brought by people who said they had been fired after their employers learned they were gay or transgender.
Donald Zarda, a skydiving instructor from New York who died in a skydiving accident in 2014 , said he was dismissed after joking with a female client with whom he was tandem-diving not to worry about the close physical contact because he was "100% gay".
It's difficult to overstate the significance of the decision.
While the court is establishing a long history of decisions expanding gay rights, this is the first time it spoke directly about the legal protections for transgender individuals.
That the ruling comes out just days after the Trump administration announced it was removing transgender health-insurance protections only puts the issue in stark relief.
Transgender rights is becoming a political battlefield, and a majority of the Supreme Court just announced which side it's on.
The company maintained he was fired because he shared personal information with a client, not because he was gay, but a court in New York ruled in Mr Zarda's favour.
Gerald Bostock, a former child welfare services co-ordinator from Georgia, lost his job after joining a gay recreational softball league, thereby publicly revealing his sexual orientation.
His employer, Clayton County, said his dismissal was the result of "conduct unbecoming of a county employee".
Mr Bostock lost his discrimination case in a federal court in Atlanta.
Michigan funeral home employee Aimee Stephens says she was fired for coming out as transgender.
She had worked as Anthony Stephens for six years before writing a letter to colleagues saying she would return to work "as my true self, Aimee Australia Stephens, in appropriate business attire".
Two weeks later, Ms Stephens was fired for insisting in working in women's clothes.
In a court filing last year, the funeral home owner argued it wanted Ms Stephens to comply with a dress code "applicable to Stephens' biological sex".
A lower court sided with Ms Stephens.