(CNN) Chief Justice John Roberts is about to get the Supreme Court back.
And it could be even better for him over the next four years.
Tuesday's election of Donald Trump as president of the United States will not only secure a conservative majority and preserve recent rulings, for example, against campaign finance regulation and for individual gun rights.
It could eventually mean a rollback of liberal precedents for abortion rights, campus affirmative action, and protections based on sexual orientation.
As with so much in the wake of Tuesday's election, expectations for the Supreme Court and law of the land turned upside down as the results came in.
Last February, when Justice Antonin Scalia died, for the first time in decades the Republican court appointees no longer held a majority. Democratic President Barack Obama, or a like-minded successor, appeared ready to fill the vacancy.
The Supreme Court was on the cusp of a historic reversal, and Roberts, the man with a golden resume, who when appointed in 2005 at age 50 was the youngest chief since John Marshall in 1801, seemed to face the greatest challenge of his life in the law.
Obama nominated Merrick Garland, a respected moderate liberal and former prosecutor who is chief judge on the U.S. Court of Appeals for the District of Columbia Circuit.
Republican Senate Majority Leader Mitch McConnell blocked Senate action on Garland, insisting that the open seat should be filled not by Obama but by whoever won this election -- a line he drew within an hour of the announcement of Scalia's death.
Obama had nearly a year left in his White House term at that moment, and given the tenor of the presidential race most of the year, installing a liberal on the court seemed just a matter of timing.
As late as Monday, there was even discussion among Senate Democrats and some Republicans over whether Garland would see a vote in the lame duck Senate before Hillary Clinton had a chance to nominate a more liberal justice.
Meanwhile, the Supreme Court of four conservatives and four liberals was in a holding pattern, deciding as little as possible and deadlocked on the most contentious issues.
Roberts was waiting it out, engaging in modest negotiations, giving up little and watching for the political situation to clarify.
Now it is clear that Trump, backed by a still-Republican Senate, will choose the next justices.
His first appointee would likely have the same conservative ideology as Scalia and the 5-to-4 polarization that defined the Roberts Court in his first decade is likely to continue.
But more than that, if any of the older liberal justices retire, Trump could deepen the conservative cast for years to come.
Senior liberal justice Ruth Bader Ginsburg is 83. The next most senior justice on the left is 78-year-old Stephen Breyer. Justice Anthony Kennedy, who is generally in the conservative camp but joined with liberals to declare a right to gay marriage in 2015 and affirm abortion rights and campus affirmative action earlier this year, is 80.
With those ages, as Ginsburg herself has said, the court could experience significant change in the next four years.
Justices are appointed for life, and a president's legacy for federal courts at all levels endures long after he leaves office.
Roberts, 61 and a student of history who considered earning a PhD at Harvard before turning to law school there, knows well the evolution of the Supreme Court he inherited in 2005.
Its scaffolding traces back nearly a half century, when liberal groundbreaker Chief Justice Earl Warren retired in 1969 and newly elected Republican President Richard Nixon replaced him with Warren Burger.
Then Nixon and a succession of Republican presidents filled most of the vacancies that arose through the years. Of the 16 new justices since 1969, 12 were Republican appointees, four Democratic, not counting William Rehnquist's elevation in 1986 from associate justice to chief.
When President George W. Bush named Roberts to the center chair, Roberts had a ready-made majority for the conservatism he had embraced since he was a young lawyer in the Ronald Reagan administration in the 1980s.
Under Roberts' leadership, the court curtailed the protections of the 1965 Voting Rights Act and other racial remedies, allowed more religion inpublic places, and restricted class-action lawsuits against corporate America.
His one significant departure from the conservative agenda came when he voted to uphold Obama's Affordable Care Act. Roberts was vilified by some Republicans for endorsing Obamacare, something Trump and other GOP candidates constantly reminded their base in the primaries.
That aside, the four liberal justices routinely protested the majority's rightward direction. In 2007, when the conservative bloc rejected school integration policies in Seattle and Louisville, Breyer said, "It is not often in the law that so few have so quickly changed so much."
More controversial rulings were yet to come.
Two that arguably most mark this bench in the public mind are 2010 Citizens United v. Federal Election Commission, which brought more corporate money into political campaigns, and 2013 Shelby County v. Holder, which scaled back voter protections, particularly in regions with a history of race discrimination.
As Clinton campaigned across the country against Trump, she and her Democratic supporters vowed to try to roll back those decisions.
Tuesday's results instead deeply secure them and likely guarantee Roberts the legacy he sought from the start.