The US Senate confirmed President Donald Trump's Supreme Court pick Brett Kavanaugh on Saturday in the closest such vote in more than a century, amid controversy over sexual abuse allegations against him.
Mr Kavanaugh has taken the oaths of office to become the 114th Supreme Court justice a few hours after the Senate voted 50-48 to approve him. More than 1,000 protesters rallied in Washington against the nominee, who had to overcome questions over his honesty, partisan rhetoric and lifestyle as a young man.
The battle over the nomination has riled American passions - the vote was disrupted on several occasions by angry protests in the gallery - but handed Trump one of the biggest victories of his presidency.
It drew the line under a bruising nomination process defined by harrowing testimony from Christine Blasey Ford who says Mr Kavanaugh tried to rape her when they were teenagers - and by his fiery rebuttal.
The two-vote margin of victory made it the closest confirmation vote since 1881, when Stanley Matthews, President James Garfield's pick, sealed a 24 to 23 win.
The confirmation means Trump has succeeded in having his two picks seated on the court - tilting it decidedly to the right in a major coup for the Republican leader less than halfway through his term.
It reflects a high water mark of the Trump presidency: Republican control of the White House, the Senate, the House of Representatives and the judiciary's top court.
Speaking to reporters outside the White House, Trump said Mr Kavanaugh is “going to be a great, great Supreme Court justice” who “will make us all proud.”
"I feel very strongly that, in the end, maybe the process was really unattractive, but the extra week was something that I think was really good," Trump said, moments before boarding Marine One to flying to a campaign rally in Kansas . "A lot of very positive things happened in the last week. It didn't look that way, but in the end that's what happened."
U.S. President Donald Trump said he is "100 percent" certain that Ms Ford named the wrong person when she accused Brett Kavanaugh of sexual assault in testimony during his Supreme Court nomination hearings.
“This is one of the reasons I chose him is because there is no one with a squeaky clean past like Brett Kavanaugh. He is an outstanding person and I’m very honoured to have chosen him,” Trump told reporters.
"We’re very honoured that he was able to withstand this horrible, horrible attack by the Democrats."
Key US senators criticise Trump for mocking Kavanaugh accuser
Just hours before the vote, scores of protesters broke through barricades and staged a raucous sit-in protest on the US Capitol steps, just feet away from the imposing doors to the Rotunda.
As protesters chanted "Shame!" and "November is coming!" police took several dozen protesters down the steps and put them in plastic flex-cuffs.
Mr Kavanaugh's confirmation process has laid bare the partisan gridlock on Capitol Hill and the political polarisation of America just a month before midterm elections.
His promotion to the Supreme Court also stands as a demoralising defeat for Democrats who had battled hard to block the 53-year-old judge at all costs.
But Senator Ed Markey insisted ahead of the confirmation that it would only galvanise Democrats to deliver a "devastating" blow to Republicans at the ballot box.
"The Democrats are going to pivot to the election, and we're going to turn this nomination into a referendum on whether or not Donald Trump can be trusted to name federal judges or to continue to control an absolute monopoly on creating public policy in the United States," Mr Markey said.
Mr Kavanaugh's confirmation had already been all but sealed on Friday, when he won the support of key Senate Republican Susan Collins and conservative Democrat Joe Manchin.
Mr Kavanaugh's confirmation as a replacement for retiring justice Anthony Kennedy was controversial from the start - but the initial focus was solely on the conservative views held by the married father of two.
His ascent to the Supreme Court was thrown into doubt last week after university research psychologist Ms Ford testified that he had sexually assaulted her at a Washington area gathering in the early 1980s.
The brutal hearing sparked a supplemental FBI probe into Mr Kavanaugh's background and a week-long delay of the Senate vote.
While many senators said they were satisfied with the FBI probe, her lawyers called the investigation insufficient.
"An FBI investigation that did not include interviews of Dr Ford and Judge Kavanaugh is not a meaningful investigation in any sense of the word," they said.
Collins - a moderate Republican from Maine - said Mr Kavanaugh was entitled to the "presumption of innocence" as the allegations against him were not substantiated with corroborating evidence.
While acknowledging that Blasey Ford's testimony was "sincere, painful and compelling," Collins added: "We will be ill-served in the long run if we abandon the presumption of innocence and fairness."
Immediately after that speech, Mr Manchin announced his support, calling Mr Kavanaugh a "qualified jurist" who "will not allow the partisan nature this process took to follow him onto the court."
Mr Kavanaugh's nomination seals a conservative majority on the nine-seat high court, possibly for decades to come.
There were loud protests, both in Washington and in other cities across the United States as the vote went ahead.
Hundreds were arrested on Capitol Hill this week - including several dozen in the hours leading to the final vote.
Authorities took the rare step of putting up low metal fences around the Capitol, keeping the public some distance from the building. But protesters overran the barricades and defiantly claimed the Capitol steps.
Trump tweeted that the demonstrators included female Mr Kavanaugh supporters who were "gathering all over Capitol Hill." But they were not immediately visible in the area around the legislature.
The president claimed on Friday that billionaire financier George Soros, a Democratic funder and frequent target of conservatives, was behind the demonstrations against his nominee.