For indispensable reporting on the coronavirus crisis, the election, and more, subscribe to the Mother Jones Daily newsletter.

Supreme Court Chief Justice John Roberts has long tried to avoid the perception that the nation’s highest court is a player in partisan politics. During a case last year involving gerrymandering, he said that if the court issued a ruling that favored the Democratic Party, people would ask, “Well, why did the Democrats win?…It must be because the Supreme Court preferred the Democrats over the Republicans.” A partisan reputation, he insisted, “is going to cause very serious harm to the status and integrity of the decisions of this court in the eyes of the country.” Since his appointment as chief justice in 2005, Roberts has also expressed concern that “partisan hostility” during Supreme Court confirmation hearings threatens the court’s integrity.

It was hard not to wonder what he was thinking during Thursday’s Supreme Court confirmation hearing, when the most vocal partisan hostility was coming from the nominee himself, Brett Kavanaugh.

Over the past several weeks, as Kavanaugh’s nomination has been delayed in the Senate amid allegations that he sexually assaulted three women during high school and college, both Republicans and Democrats have fixated on the potential impact of his confirmation on the November midterm elections and major judicial issues like the future of Roe v. Wade. But Kavanaugh’s lashing out at Democrats during last week’s hearing showed how fundamentally his confirmation could corrode the integrity of the Supreme Court as an independent third branch of government. And there may be no one who cares more about that than its chief justice, the man who could end up being Kavanaugh’s boss in just a few weeks.

“I can’t imagine John Roberts was happy about that opening statement,” says Jill Dash, vice president for strategic engagement at the American Constitution Society, a liberal legal advocacy group. “He has done quite a bit to try to lift up the institution as a fair and neutral place to bring claims.”

Kavanaugh’s partisan outburst during his testimony before the Senate Judiciary Committee has raised the possibility that Congress will confirm the most openly politically biased Supreme Court justice in modern history. His addition to the court threatens to undermine public confidence in an institution already struggling under criticism that it’s a “captured agency, dancing to special-interest tunes,” as Sen. Sheldon Whitehouse (D-R.I.) described it Friday.

The court has been on troubled footing for a while now, ever since it ruled in 2000 to give the presidential election to George W. Bush in Bush v. Gore. After the replacement of Sandra Day O’Connor with Samuel Alito in 2006 shifted the court further to the right, it has issued a number of contentious 5-4 rulings that split sharply along ideological lines, including the 2010 Citizens United decision allowing unlimited money in American elections and the 2012 decision gutting the Voting Rights Act. The percentage of Americans who say they have significant confidence in the Supreme Court as an institution has plummeted from around 50 percent in 2001 to only 37 percent today, according to Gallup.

If Kavanaugh is confirmed, he would arrive at the court as one of its most unpopular justices ever, with recent polls showing that only 42 percent of voters think he should be confirmed. His nakedly partisan comments during his confirmation hearing aren’t likely to help the court’s standing with the public. Shouting at members of the Senate Judiciary Committee, Kavanaugh blamed his predicament on a vast left-wing conspiracy. “This whole two-week effort has been a calculated and orchestrated political hit fueled with apparent pent-up anger about President Trump and the 2016 election, fear that has been unfairly stoked about my judicial record, revenge on behalf of the Clintons, and millions of dollars and money from outside left-wing opposition groups,” he raged.

Despite many of the court’s recent controversial 5-4 rulings, Roberts has attempted to build consensus among the court’s liberal and conservative factions when possible. In 2006, at the end of his first term, Roberts told legal analyst Jeff Rosen, “Politics are closely divided. The same with the Congress. There ought to be some sense of some stability, if the government is not going to polarize completely. It’s a high priority to keep any kind of partisan divide out of the judiciary as well.”

Roberts has said he believes 5-4 decisions are bad for the stability of the law. He wants the court to speak with a single voice, not as a collection of egos, each writing his or her own opinions to impress the world with brilliance. But these days, the court is populated with a lot of prima donnas and bruised egos. There’s Justice Clarence Thomas, whose confirmation process most resembles Kavanaugh’s, overshadowed by allegations of sexual harassment. Thomas has proven largely unable to persuade many of his colleagues to sign on to his quirky legal reasoning. Justice Ruth Bader Ginsburg has indulged efforts to transform her into a pop-culture icon, even allowing documentary makers to film her working out. And then there’s the court’s newest addition, Justice Neil Gorsuch, who kicked off his first term by writing his own concurrences and dissents in an unusually large number of cases for a junior justice, apparently slowing the court’s work.

The arrival of a bitter, partisan Justice Kavanaugh into this mix could further set back Roberts’ efforts to build good will across the aisle. Roberts and Kavanaugh have similar backgrounds. They both played football at all-boys Catholic high schools, went to Ivy League colleges, and served in Republican presidential administrations before getting appointed to the powerful DC Circuit Court of Appeals. They even belong to the same exclusive country club in suburban Maryland. But the similarities end there. Roberts has tried to avoid the appearance of personal bias; unlike Thomas, Alito, and Kavanaugh, he no longer gives speeches to conservative legal organizations. He does not duck hunt with Dick Cheney, as Scalia did. In court, he appears to be a careful, dignified man, who reportedly cares immensely about the image of the institution he runs as a bastion of impartial justice.

By contrast, on Thursday, Kavanaugh went on what Slate writer Dahlia Lithwick described as “a blind partisan tantrum in which he dragged the judicial branch down to a place of ugliness and rancor from which it will not soon recover.”

Legal observers were shocked by the raw partisanship. “If Kavanaugh is ultimately confirmed, it will be a significant blow to the perceived legitimacy and integrity of the court,” says Emily Martin, a vice president at the National Women’s Law Center. “His vengeful and nakedly partisan attacks against those seeking further investigation of the credible charges against him threaten to strip any veneer of judicial impartiality from his future decisions.”

Roberts’ job of holding the court together with the addition of Kavanaugh would be even harder than the one faced by Chief Justice William Rehnquist in 1991, when Thomas joined the court. The sexual harassment investigation of Thomas ended with his swearing-in. But Democrats have vowed to continue investigating the sexual assault allegations against Kavanaugh if he’s confirmed and they retake one or both houses of Congress. And there’s talk of impeachment proceedings—an unprecedented event in the history of the court. (The only time Congress attempted—and failed—to impeach a Supreme Court justice was in 1804.) There’s no modern precedent for the court to be operating while one of its justices is under investigation for an extended period.

“Everybody keeps talking about when the constitutional crisis is coming,” says the American Constitution Society’s Dash. “It’s here.”