Supreme Court Chief Justice administers the presidential oath of office to Barack Obama on Jan. 20, 2009. He’ll perform the same role for President-elect Donald Trump on Friday. (Rick Wilking/Reuters)

Chief Justice John G. Roberts Jr. will once again don his black robe on Friday and head across the street to the Capitol to administer the presidential oath of office.

It’s fortunate Roberts has a lifetime appointment. Maybe one day he’ll see a friendly face on the other side of the Bible.

If it had been up to Barack Obama, the first president the chief justice swore in, Roberts wouldn’t even have been on the Supreme Court. Obama as a senator voted against his confirmation.

Their up-and-down history includes the muffed 2009 oath, Obama’s scolding of the court at a State of the Union address for the Citizens United ruling, Roberts’s lifeline to the Affordable Care Act and his hollowing-out of the Voting Rights Act, which Obama denounced.

And the new president? Donald Trump said Roberts “looked like a dummy” for casting the deciding vote to shoot down the challenge to Obamacare. During the campaign, Trump muscled his Republican competitors into denouncing Roberts — even those who had worked hard for his confirmation (Sen. Ted Cruz) or had a brother who chose Roberts in the first place (Jeb Bush).

(The Washington Post)

The chief justice “turned out to be a nightmare for conservatives,” Trump said in just one of many pans of Roberts.

Justin Driver, a University of Chicago law professor who studies and writes about the Supreme Court, said it is hard to think of a president-elect who has more actively attacked a chief justice appointed by a president of the same political party.

Perhaps when Chief Justice Earl Warren administered the oath to Richard M. Nixon, Driver suggested. But even then, Nixon was more critical of the court as a whole than of Warren.

Still, the swearing-in must bring mixed emotions for Roberts: Trump’s victory means that the court will continue to have a majority of conservative justices appointed by Republicans. Before the election, most speculation was about how the conservative Roberts would conduct himself if the court had a liberal majority.

“Without Trump, Roberts would have been a ‘CJINO’ — a chief justice in name only,” Driver said. “We would have had Chief Justice Ginsburg, for all practical purposes.” Justice Ruth Bader Ginsburg would have been the senior justice among five liberals named by Democratic presidents should Hillary Clinton have won.

Even if Roberts liked and respected Judge Merrick Garland, Obama’s ill-fated choice to fill the seat of the late Justice Antonin Scalia, any of the 21 people on Trump’s list of potential Supreme Court nominees will be ideologically closer to the chief justice.

Trump could not arrange a visit to the court before the inauguration, as Obama had done before he took office. But court public information officer Kathleen Arberg said the two men met briefly Thursday afternoon at Blair House to discuss inaugural preparations.

If there is any tension between Roberts and Trump, it probably will not be evident from the chief justice’s demeanor. He is cool and relentlessly positive, determined to be the respectful head of his branch of government and avoid controversy in all areas except for his rulings.

He remained — frustratingly to some — out of the political fray on whether the Republican-led Senate should have held a hearing and vote on Garland. He has complained in the past that partisan battles over Supreme Court nominations hurt the court’s reputation with the public, but he dodged all chances to say that having only eight members hampered the court’s performance.

In the past, he has said one of his role models for how to do his job is Chief Justice Charles Evans Hughes, who led the court at a time President Franklin D. Roosevelt had declared war on it for striking down his policy proposals. Hughes resisted calls to respond publicly to Roosevelt, Roberts said in a 2015 speech.

“Hughes appreciated that that would be sort of fighting the battle on the enemy’s turf,” the chief justice said.

Temperamentally, Roberts seems more like his fellow Harvard Law graduate Obama than he does the excitable Trump.

The chief justice and the president have a history; Roberts actually has delivered the oath four times to Obama: the 2009 bungle, a do-over the next day at the White House, an official swearing-in with only Roberts and the Obama family on Sunday, Jan. 20, 2013, and a ceremonial oath at the inauguration the next day.

The two haven’t agreed on much. They clashed over Obama’s criticism of the court at the 2010 State of the Union address, and Obama has particularly lamented the court’s decisions on campaign finance laws and the Voting Rights Act. Obama considers the court’s recognition of the constitutional right for same-sex couples to marry a signature achievement; Roberts voted against it.

Roberts’s opinion upholding the Affordable Care Act was a grudging one but still was a bitter disappointment to conservatives in general and Republicans in particular. But it is often said that Roberts, who became chief justice at the age of 50, plays a long game.

And with Trump as president and Republican control of Congress, Obamacare is on the chopping block not because of the judiciary, but because of the political branches.

In his opinion upholding the constitutionality of the Affordable Care Act, Roberts said that is how it should be.

“Members of this court are vested with the authority to interpret the law; we possess neither the expertise nor the prerogative to make policy judgments,” Roberts wrote.

“Those decisions are entrusted to our nation’s elected leaders, who can be thrown out of office if the people disagree with them. It is not our job to protect the people from the consequences of their political choices.”