Republicans installed Brett M. Kavanaugh on the Supreme Court, then they turned him into an election-year rallying cry.

In the sprint to next week’s midterms, the GOP has used Kavanaugh and his fight for Senate confirmation amid allegations of sexual assault to energize Republican voters in districts and states won by President Trump in 2016. They have cast Kavanaugh as a wrongly accused family man — the victim of an overzealous #MeToo movement and Democrats seeking retribution for Hillary Clinton’s loss.

Republicans hope voters will turn out to defend what they believe the conservative justice represents — traditional values under threat and the dangers of what some have called the liberal “mob.”

“This is the number one issue, I think, for America in November,” Sen. Lindsey O. Graham (R-S.C.), a vocal Kavanaugh defender, said this month on Fox News.

“Do you agree with what they did to Brett Kavanaugh? Do you believe that what they did was okay? And if you believe it was okay, vote Democrat. If you thought it was despicable, vote for us,” Graham said.

Trump has invoked Kavanaugh repeatedly at campaign rallies across the country this month, calling the accusations — which Kavanaugh has vehemently denied — a political setup by Democrats.

“Boy, oh, did they treat him horribly,” Trump said this past weekend in Murphysboro, Ill. “Did they treat him badly. A great scholar, a great intellect, a great person, great family.”

Using a recent refrain, Trump said the midterm elections would be about “the caravans, the Kavanaughs, law and order, tax cuts and . . . common sense, because most of it is common sense.”

Peter Irons, a political scientist at the University of California at San Diego who studies the Supreme Court, said Republicans’ politicization of Kavanaugh is almost without precedent.

“Hardly any Supreme Court nominees have been turned into campaign issues,” he said. “I think Kavanaugh is unique in that sense.”

Irons added that increased politicization is a “very real danger” for the high court in general.

“Everyone’s saying you’ve got five Republicans and four Democrats and they’re going to act in very predictable ways. By and large, this has become a very defining issue in appealing to voters,” he said.

The elevation of Kavanaugh as a campaign issue comes after a bruising fight over his nomination, as several women accused him of sexual misconduct during his high school and college years.

The allegations saturated national news for several weeks, upending the confirmation process and drawing hundreds of protesters to Capitol Hill, where they confronted senators, engaged in demonstrations and disrupted hearings.

On Sept. 25, after protesters heckled Sen. Ted Cruz (R-Tex.) and his wife at a restaurant near the Capitol, Republicans began to describe them as a “mob” of embittered Democrats bent on destroying an innocent Kavanaugh.

The rhetoric shifted to the campaign after Kavanaugh was confirmed Oct. 6.

That night in Topeka, Kan., Trump said that Democrats had turned into an “angry mob” and that their treatment of Kavanaugh and his family was “unthinkable.”

“Each of you will have a chance in just four weeks to render your verdict on the Democrats’ conduct at the ballot box,” he said.

Trump has extolled Kavanaugh at events for GOP candidates in Kentucky, Montana, Nevada, Ohio, Pennsylvania, Tennessee, Texas and Wisconsin.

Graham has seized on Kavanaugh’s confirmation battle as he crisscrosses the country for GOP Senate candidates such as incumbent Sen. Dean Heller (Nev.), Montana State Auditor Matt Rosendale and Rep. Marsha Blackburn (Tenn.).

“Who do you want to run your government?” Graham said Sunday at an event for Blackburn in Nashville. “You want the people that are going to destroy this man to be in charge? They wanted power so badly that there’s nothing they wouldn’t do.”

The issue has also come up in Senate debates in North Dakota, Minnesota, Arizona and Missouri, where Attorney General Josh Hawley portrayed Sen. Claire McCaskill as one of the Democrats who had “laid in wait to try to ruin [Kavanaugh] and his family.”

“When you see these mobs popping up in the wake of the Kavanaugh hearings, the screaming, the shouting, driving people out of restaurants and confronting them, this is terrible. This is not the United States of America,” Hawley said at a debate last week.

McCaskill voted against Kavanaugh, but she is not a member of the Senate Judiciary Committee that held hearings on his nomination. She said that she “did not participate in the chaos around the Kavanaugh confirmation.”

Politics was at issue from the beginning of Kavanaugh’s confirmation, when Democrats raised concerns about the nominee’s fitness for the high court given his work as a staffer for Kenneth Starr, who led a lengthy investigation into President Bill Clinton, and the George W. Bush White House.

Kavanaugh also raised eyebrows when he said during a widely viewed congressional hearing on Sept. 27 that the women’s sexual assault allegations were an “orchestrated political hit” fueled by “pent-up anger about President Trump” and a desire for “revenge on behalf of the Clintons.”

The next week, as former justice John Paul Stevens described Kavanaugh’s comments as disqualifying, he sought to repair the damage in an op-ed titled, “I Am an Independent, Impartial Judge.”

“Yes, I was emotional last Thursday. I hope everyone can understand I was there as a son, husband and dad,” Kavanaugh wrote in the Wall Street Journal.

A Washington Post-ABC News poll from this month suggested that Kavanaugh’s confirmation has eroded confidence in the nonpartisanship of the high court, as 43 percent of Americans believe the court’s rulings will be more politically motivated now that Kavanaugh is a member.

Both conservative and liberal justices have tried to assuage such fears, pointing out how often the court votes unanimously and stressing their nonpartisan and congenial relations.

Chief Justice John G. Roberts Jr. directly confronted the issue during a speech this month, telling an audience at the University of Minnesota that he wanted to “assure” them that the court serves “one nation” and not “one party or one interest.” Roberts also made a point of noting that he was paraphrasing Kavanaugh.

But that image of independence is undermined by some of Trump’s comments, some experts said. Trump, more than any presidential candidate in recent history, made the Supreme Court an election issue and has celebrated his nominees’ contribution to a fortified conservative court.

“Remember, this is part and parcel of what the president promised to deliver,” said Dennis Hutchinson, a law professor and court scholar at the University of Chicago.

Recent comments from other top Republicans have also cast the court in a political light.

Former House speaker Newt Gingrich said this month that Republicans would “see whether or not the Kavanaugh fight was worth it” if Democrats win the House and subpoena Trump’s tax returns. Senate Majority Leader Mitch McConnell (R-Ky.) signaled that he would help fill a high-court vacancy if one emerges in 2020, despite blocking President Barack Obama’s 2016 nominee on the argument that it was a presidential election year.

At a celebration at the White House just after his confirmation, Kavanaugh stressed that he would be nonpartisan. But Hutchinson said he felt that Kavanaugh undermined his point with his effusive praise of the Republican senators and one Democrat who supported him.

“I thank the members of the United States Senate: Senate Majority Leader Mitch McConnell for his leadership and steady resolve. I thank Judiciary Committee Chairman Chuck Grassley for his wisdom and fairness. And I give special gratitude to Senators Rob Portman, Susan Collins, Joe Manchin, Jon Kyl, and Lindsey Graham. They’re a credit to the country and the Senate,” Kavanaugh said.

“I could not believe that and wondered how the eight [other members of the court] felt sitting there,” Hutchinson said.