The Senate narrowly confirmed Brett Kavanaugh to the U.S. Supreme Court on Saturday, ending a divisive, bitter and downright ugly nomination process marked by allegations of sexual misconduct, lying under oath and out-of-bounds youthful behavior against the man who will now fill a lifetime role on the nation’s highest court.

The final tally was 50 yes votes to 48 noes, the closest margin for the confirmation of a Supreme Court Justice since 1881. As the Senate began casting votes around 3:45 p.m., intermittent screams of “I do not consent,” and “shame” echoed through the chamber with new protesters joining moments after others had been hauled from the gallery as Vice President Mike Pence, who was presiding over vote, ordered the sergeant at arms to have them removed by Capitol police.

Kavanaugh was sworn in shortly after, in a court building across the street as hundreds stood in protest outside.

Sen. Lisa Murkowksi (R-AK) was the lone Republican defector, but agreed to vote present to allow for Sen. Steve Daines (R-MT) to attend his daughter’s wedding in Montana without having to fly back to D.C. to cast a critical “yes” vote. Sen. Joe Manchin (D-WV) was the only Democrat to support Kavanaugh’s nomination.

The gallery above the chamber was studded with notables from the confirmation fight. Debra Katz and Lisa Banks sat just a section away from vocal Kavanaugh defender and former Bush White House colleague Sara Fagan. In the center of the room sat White House spokesman Raj Shah a few seats away from White House counsel Don McGahn, who watched the votes with his head perched on his hand.

The vote was briefly held open due to Sen. Tom Carper (D-DE), who arrived late looking slightly frazzled after driving from Delaware where he was holding constituents events. After he quickly stood behind his desk to cast a “no” vote, Pence warned the gallery against expressions of glee or disappointment—as both are against Senate decorum.

After Pence gaveled the vote closed, McGahn initially stared straight on to the Senate floor expressionless, and then, appearing to catch someone’s eye, mimed wiping his brow in relief.

Kavanaugh’s confirmation process was one of the most bitter in recent memory and it has left the Senate—and the country—in a raw and angry state.

Members have decried the current moment as a low point of partisan rancor, with Democrats accusing Republicans of forcing through a deeply flawed nominee and Republicans countering that Democrats tried, and failed, to use innuendo to smear an immensely qualified judge.

The acrimony will almost certainly spill immediately into the midterm elections, which are less than four weeks away. Both Senate Republicans and President Donald Trump have said that the Kavanaugh fight has enraged and impassioned conservative voters, helping them close a voter enthusiasm gap that threatened their congressional majorities.

Democrats, on the other hand, hope to harness the anger particularly from women incensed the perceived dismissal of the #MeToo movement and the treatment of Kavanaugh accusers, Dr. Christine Blasey Ford and Debbie Ramirez, by the president and his allies.

After the vote on Saturday, Sen. Lindsey Graham (R-SC) who was one of Kavanaugh’s more vehement defenders, said he was concerned about what the slugfest meant for future nominations. “I’m worried. Does this turn a corner or not?” he said. “I voted for Sotomayor and Kagan and the reason I got so pissed is, you know, there is a way you do this... But, wow, what blew me away was how vicious it was. We can’t have winning at all cost.”

Graham added, “I think what happened to Kavanaugh was unsustainable. You don’t think our people can do this, you aren’t looking.”

Senate Majority Leader Mitch McConnell cast a more optimistic future. “The Senate and the country will get passed this. We always do,” he told reporters after the vote. “The geniuses who put together the Constitution knew what they were doing.”

Kavanaugh, who has served for 12 years on the federal bench, will replace Justice Anthony Kennedy, who retired earlier this year. He is Trump’s second Supreme Court pick in less than two years, and his presence on the highest court, along with the confirmation of dozens of other Trump-nominated federal judges, will have profound effects on the country for decades to come. Everything from regulatory frameworks to abortion rights could be revamped under the country’s fundamentally more conservative judicial tilt.

All of which is why the nomination was fought so bitterly. Even before Kavanaugh was accused of sexual assault by peers from high school and college, Democrats had pledged to oppose him en masse, citing his judicial record of leniency towards executive powers, his years as a Republican operative, and the threat he posed to abortion rights. Protesters roamed the halls of the Hart building where his first hearing was held dressed as handmaids from the dystopian Handmaid’s Tale and several dozen more were arrested for yelling during those proceedings at senators to oppose Kavanaugh.

Then on Sunday, September 9, the nomination took a dark turn. Ford, a California professor who graduated from a Washington-area private school, told The Washington Post Kavanaugh sexually assaulted her when he was drunk at a party in high school.

A week later, Ramirez went public with her allegation that Kavanaugh exposed himself to her when they were freshmen at Yale University, putting his confirmation even further in doubt. Kavanaugh denied both allegations.

The allegations culminated in a riveting public hearing before the judiciary committee, where

Ford detailed her memory of the assault that she said occurred three decades before.

“I believed he was going to rape me,” she told the committee, detailing how Kavanaugh put his hand over her mouth to stop her from screaming.

But Republicans, led by Kavanaugh himself, mounted a vigorous and aggressive pushback. The nominee offered an emotional, angry denial, accusing Democrats of exacting “revenge” for the Clintons and conspiring to ruin him. He was combative with Democratic senators, even at one point asking one if she had a drinking problem as a response to a question about whether he ever drank alcohol to excess.

After the hearing, Republican Judiciary Committee Chairman Chuck Grassley (R-IA) was determined to move the nomination forward, scheduling a committee vote on the nomination two days after the testimonies.

That Friday, as committee Republicans defiantly rallied behind Kavanaugh, Sen. Jeff Flake (R-AZ), who had just announced his support for the nominee, rolled a last-minute grenade into the process. After an emotional confrontation with a sexual assault survivor in an elevator on his way to the meeting, Flake, who was already wrestling with his decision, called for a pause in the process for a week-long FBI investigation into claims made by Ford and Ramirez. The idea, first floated by Sen. Chris Coons (D-DE), led to a probe limited in time and scope. Flake made his “yes” vote contingent on the FBI investigating the allegations.

Five days later, the FBI delivered its findings to the Senate on Wednesday night, Senate Majority Leader Mitch McConnell (R-KY) formally kicked off the Kavanaugh debate on the floor, leading to Saturday’s final vote. By Thursday, Republican senators who read the FBI’s report said it did not corroborate the allegations, re-affirming their support for Kavanaugh. Democrats, meanwhile, said the investigation was insufficient and did not include interviews with key witnesses.

Up until Friday, it was unclear who would prevail. A procedural vote taken in the morning passed 51-49, giving Republicans hope that Kavanaugh would be confirmed. But the final push came when Sen. Susan Collins (R-ME) announced she would support Kavanaugh’s confirmation and Manchin soon followed.

Collins, a moderate who supports abortion rights, defended Kavanaugh’s judicial opinions as well as his sometimes-partisan Senate testimony. She added that she had been persuaded that he would uphold Roe v. Wade during private conversations the two had over the past few weeks. The Senator said she believed Ford was sincere in her allegations but expressed extreme skepticism about the case that was built against Kavanaugh and the importance of the presumption of innocence.

"I do not believe that these charges can fairly prevent Judge Kavanaugh from serving on the court,” she said.

And over just 24 hours later, Kavanaugh was elevated to a Supreme Court Justice during a private ceremony.

Several senators lingered on the floor after the vote. Sen. Bob Corker (R-TN) shook McConnell’s hand, followed by Graham and Doug Jones (D-AL), who voted no on the nomination. Collins was immediately surrounded by well-wishing Republican colleagues.

Murkowski who sat next to her was approached by Sen. Shelley Moore Capito (R-WV) who shook her hand. Capito was followed by several other Republican colleagues including Sen. Orrin Hatch (R-Utah) who hugged the Alaskan senator and gave her a kiss on the cheek.

Collins was one of the last to leave the chamber, picking up abandoned copies of the congressional record from her fellow senator’s desks. The Oct. 5 edition contained the speech that solidified the vote.

— Andrew Desiderio contributed to this story.

More Kavanaugh coverage: