WASHINGTON ― The Senate confirmed Brett Kavanaugh to the Supreme Court on Saturday, ending an ugly, painful, weekslong Senate fight over whether women’s sexual misconduct allegations against him were credible and mattered.

Kavanaugh was narrowly confirmed, 50-48. Every Republican but one, Sen. Lisa Murkowski (Alaska), voted for him. Every Democrat but one, Sen. Joe Manchin (W.Va.), voted against him.

The vote would have been 51-49, but Murkowski, whose vote will be recorded as “no,” agreed to vote “present” during the actual vote as a favor to Sen. Steve Daines (R-Mont.), who supports Kavanaugh but was away at his daughter’s wedding. By voting “present,” and with Daines out, the final tally was 50-48. Their paired vote, as it’s called, maintains the same two-vote margin and does not change the outcome.

Kavanaugh’s fate ultimately came down to four senators who were undecided on how they would vote until the very end: Susan Collins (R-Maine), Jeff Flake (R-Ariz.), Murkowski and Manchin. Murkowski was the only one of the four who did not support him.

Anti-Kavanaugh demonstrators in the Senate balcony shouted protests throughout the vote.

“You are a coward! You’re a total coward!” one protester yelled at Flake as he voted for Kavanaugh.

“Shame on you,” two female protesters shouted at Manchin as he voted yes. “How dare you prioritize him over us.”

Capitol Police on Saturday arrested 164 demonstrators, including 13 people who screamed at lawmakers inside the Senate gallery.

“This is a stain on American history,” one woman shouted.

BREAKING: Protests erupt in the Senate as VP Pence presides over the vote on Judge Kavanaugh's confirmation. https://t.co/f32ecMfRed pic.twitter.com/QdbjWrN6JE — MSNBC (@MSNBC) October 6, 2018

Democrats had never been particularly happy with Kavanaugh, who was a judge on the D.C. Circuit Court of Appeals. They raised concerns about his judicial philosophy and how he would rule on abortion and health care issues. But his nomination blew up completely last month when Dr. Christine Blasey Ford, a California professor, publicly came forward with allegations that Kavanaugh tried to rape her in high school.

Story continues

Millions of people watched as Ford testified before the Senate Judiciary Committee, describing a 1982 party where a drunk Kavanaugh and his friend, Mark Judge, allegedly pushed her into a room, pinned her down, groped her and covered her mouth when she tried to scream. Her testimony took place as two more women came forward with sexual misconduct allegations against him.

Kavanaugh denied all of the allegations, alternating between crying, yelling and interrupting Senate committee members as they pressed him on Ford’s story. His unhinged behavior raised a fresh round of questions about whether he had the temperament to be a Supreme Court justice. He blamed his rocky confirmation process on politics. He sneered at female senators on the committee. He repeatedly lied under oath about little and big things.

Brett Kavanaugh is on his way to the Supreme Court, despite public allegations of sexual assault or misconduct by three women. (Photo: ANDREW HARNIK via Getty Images)

Yet none of that was enough to sway Republicans to oppose Kavanaugh. Some argued that Ford’s contemporaries couldn’t corroborate her story, despite Ford securing affidavits from four people who said she previously told them about Kavanaugh’s alleged attack. Others said they believed Ford was sexually assaulted by someone, but that it couldn’t have been Kavanaugh.

None of them could answer the question at the heart of their decision to support Kavanaugh: whether they believe Ford is lying, or whether they believe she is telling the truth but that her allegations don’t matter for judging the character of a nominee to a lifetime seat on the Supreme Court.

Meanwhile, Republicans raged against the other women’s accusations. One woman said that in high school, Kavanaugh attended parties where groups of boys would rape girls (though she didn’t say she’d witnessed Kavanaugh himself committing rape). To Republicans ― especially Sen. Lindsey Graham (S.C.) ― this was a straightforward “gang rape” accusation, one so obviously ridiculous that it became a rallying cry.

Ahead of a procedural vote on Friday, Senate Majority Leader Mitch McConnell (R-Ky.) framed the confirmation fight not only as a battle over the Supreme Court, but as a test of whether the Senate should believe allegations against a nominee that don’t come with firm corroboration.

That, McConnell said, is the statement the Senate will make with its Kavanaugh vote.

“We will either state that partisan politics can override the presumption of innocence, or we will reaffirm that, in the United States of America, everyone is innocent until proven guilty,” he said.

Kavanaugh’s confirmation flies in the face of the cultural and political Me Too movement, which has empowered women in all walks of life to speak out about sexual assault and harassment, especially by men in positions of power. The movement began partly in response to the election of President Donald Trump, who has bragged on tape about sexual assault and been publicly accused of assault or misconduct by more than 20 women.

Collins said Friday that she was confident that Kavanaugh will not overturn Roe v. Wade, the landmark Supreme Court decision that legalized abortion in the U.S. She also said that she believes Ford, but thinks somebody else besides Kavanaugh must have been the perpetrator. This is despite Ford testifying, under oath, that she is “100 percent” sure that Kavanaugh was her attacker.

“We must listen to survivors,” Collins declared Friday in a sweeping Senate floor speech about doing the right thing, moments before pledging to vote for Kavanaugh. “The Me Too movement is real, it matters, it is needed, and it is long overdue.”

Need help? Visit RAINN’s National Sexual Assault Online Hotline or the National Sexual Violence Resource Center’s website.

Love HuffPost? Become a founding member of HuffPost Plus today.

This article originally appeared on HuffPost.