US President Donald Trump scored a political victory when the Senate voted by a razor thin margin to confirm Judge Brett Kavanaugh, his nominee who battled last-minute accusations of sexual assault while a teenager in high school 36 years ago, as the Supreme Court Justice.
Within hours of the Senate vote on Saturday 50 to 48 in his favour, Kavanaugh was sworn in by Chief Justice John Roberts, solidifying the conservative majority in the nation's top court.
It now has five conservatives ranged against four liberals, and with lifetime appointments for judges, 53-year-old Kavanaugh can be expected to impact the court for decades.
He succeeds Anthony Kennedy, who retired, and is the second judge nominated by Trump to the Supreme Court, giving him an opportunity to put his right-wing seal on the court.
The nomination process has ripped open the scabs on the never-healed wounds of polarisation on the US body politic exactly a month before the mid-term elections to Congress that can determine the future of Trump's presidency.
Vociferous protests broke out across the nation against Kavanaugh's nomination before and after the vote on Saturday, and was even carried into the Senate chambers from where demonstrators were ejected.
On the opposing side, his supporters rallied behind Trump, who ridiculed Kavanaugh's main accuser, Christine Blasey Ford, and the others opposing him calling them "an angry left-wing mob".
Republican Senator Susan Collins, who voted for Kavanaugh after a cliff-hanger, said it was a "confirmation process that has become so dysfunctional, it looks more like a caricature of a gutter-level political campaign than a solemn occasion".
The last minute ambush of Kavanaugh was done with an eye on the upcoming elections by the Democrats, who hoped the battle would reinvigorate their base.
During the final moments before the vote, Senate Democratic Party leader Chuck Schumer said: "To Americans, to so many millions who are outraged by what happened here, there's one answer: Vote" in November.
But Republican Senate Majority Leader Mitch McConnell, claimed the confrontation would turn out to his party's advantage.
"It certainly had a good impact for us," and added that the Democrat's tactics "have turned our base on fire."
For Trump, the past week brought another victory ahead of the elections: He managed to redeem a 2016 poll pledge to get the North American Free Trade Agreement (Nafta)with Canada and Mexico changed to more favourable terms for the US and achieved it by brow-beating Canada's Prime Minister Justin Trudeau.
Besides the accusations of sexual misconduct, another issue -- abortion rights -- mobilised the opposition to Kavanaugh.
Liberals fear that by solidifying the conservative majority, the articulate judge could overturn or restrict a 1973 verdict banning state and federal regulations criminalising or restricting abortion, which the right-wing supporters of Trump want.
They also fear that the court can now make several rulings whittling down social legislation and programmes for healthcare, aid for the poor, reservations in college admissions and immigration, while being pro-business and stricter on law and order.
While his accuser, Ford, a research psychologist at a California university, had written to her Congressional Representative with her allegations against Kavanaugh in July, it was publicised by the Democrats only in September after the Senate Judiciary Committee had grilled him and was about to vote on recommending his nomination to the entire Senate.
They appeared to have counted on delaying the confirmation process so that if the Senate majority flips to their side in the November elections, they can block him and temper Trump's future nominations.
Ford testified at a Judicial Committee hearing that Kavanaugh had pushed her on to a bed and choked her while trying to take off her clothes during a 1982 party and she feared she was going to the killed before managing to escape.
While she said she was 100 per cent sure the assailant was him, she acknowledged she did not remember many of the details.
He denied the accusations and launched an impassioned attack on his accusers, leading to fresh charges that he was temperamentally unsuited to the judgeship.
Meanwhile, another woman, Deborah Ramirez who is married to a technology entrepreneur of Indian descent, Vikram Shah, alleged that while they were students at Yale, Kavanaugh had exposed his genitals in front of her at a party they had been drinking at.
She and a third accuser, who said that she had seen him lined up outside a room with other boys waiting to "take turns" with a girl inside, were not asked to testify before the Senate Committee.
Ultimately with no evidence from 36 years ago, the Ford-Kavanaugh hearing convinced only one Republican and one Democrat to switch sides.
With the controversy over the nomination focused on alleged victimising of women, Republican Senator Lisa Murkowski opposed his nomination.
A Democratic Senator, Joe Manchin, who represents West Virginia, a heavily pro-Trump state, voted for Kavanaugh.
Walking a fine line, some conceded that they believed Ford was telling the truth that she was attacked at the party, but did not think the attacker was Kavanaugh.
The final vote by the entire Senate was further delayed by Republican Senator Floyd Flake, a critic of Trump, demanding an investigation of Ford's allegations by the Federal Bureau of Investigation.
The investigation was wrapped up in about five days and it convinced Flake to back Kavanaugh.
There is an element of irony in Kavanaugh facing sexual misconduct charges: He was a lawyer in the office of Independent Counsel Kenneth Starr, who investigated sexual misconduct charges against former President Bill Clinton, whose wife Hillary lost to Trump in the 2016 presidential election.
The Kavanaugh case before the Senate Judicial Committee seemed a throw-back to the 1991 confirmation hearing of Supreme Court Judge Clarence Thomas, when he faced sexual misconduct allegations -- but only that he made romantic overtures to a subordinate and told her dirty jokes.
The conservative was confirmed as judge.
An Indian American federal appeals court judge, Amul Thapar, was among those Trump considered for the Supreme Court before deciding on Kavanaugh.