The US Supreme Court over the past several decades has slowly but steadily expanded its protections of gay rights.
From striking down a Texas law that criminalised "sodomy" to legalising gay marriage across the nation, the direction of US jurisprudence seemed clear.
That was before Justice Anthony Kennedy, the author of several of those landmark decisions, retired and Donald Trump, with two appointments, gave the court a decidedly more conservative bent.
There was some concern among LGBT advocates that the newly composed court would use this year's two high-profile gay and transgender rights cases to take the nation in a different direction.
Those concerns proved unfounded. Neil Gorsuch, one of the Trump appointees, wrote the sweeping decision that extended federal employment protections to gay and transgender workers.
He is proving to be more of an ideological wildcard than many on the left expected.
Chief Justice John Roberts, another Republican-appointed justice who has at times defied predictions, joined to give the ruling a comfortable 6-to-3 margin.
Both are sure to face an uproar from conservatives quarters.
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.