The president, according to half a dozen officials and people working on the confirmation, came to the determination that with the midterms rapidly approaching, he needed the Senate to confirm the conservative justice to avoid depressing GOP turnout come November.

White House aides and allies conceded that throughout the touch-and-go confirmation battle, they weren’t sure whether Kavanaugh would hold on in the face of the sexual assault allegations and the prevailing #MeToo movement that has swept the country for more than a year. But with Sen. Susan Collins (R-Maine) coming out in support of Kavanaugh Friday afternoon — giving the judge enough votes to get through — Trump’s gamble to stand with him has conservatives feeling like they narrowly escaped catastrophe.

“Abandoning Kavanaugh under the existing circumstances would have demoralized the base,” said Saul Anuzis, a former chairman of the Michigan Republican Party. “One can second-guess individual tactics, but the Kavanaugh confirmation process, win or lose, has been helpful in waking up a lethargic Republican Party.”