The Senate has confirmed Brett Kavanaugh as an associate justice of the Supreme Court, putting a second nominee from President Donald Trump on the highest court in the land.
Mr Kavanaugh was confirmed 50-48 during a historic roll call vote in the Senate chamber.
The two-vote margin is one of the narrowest ever for a Supreme Court nominee. The vote unfolded with protesters shouting from the gallery.
The vote ends a bitter struggle over Mr Kavanaugh’s nomination, inflamed by accusations that he sexually assaulted women in the 1980s.
Mr Kavanaugh denied the accusations in sworn testimony.
In final remarks just before the voting, Senate Republican leader Mitch McConnell said a vote for Mr Kavanaugh was “a vote to end this brief, dark chapter in the Senate’s history and turn the page toward a brighter tomorrow”.
Democratic leader Chuck Schumer looked ahead to mid-term elections in November, and appealed to voters beyond the Senate chamber: “Change must come from where change in America always begins: the ballot box.”
Rep Joe Manchin, confronting a tough re-election race next month in a state that President Trump won in 2016 by a landslide, was the sole Democrat to vote against Mr Kavanaugh.
Every voting Republican backed the 53-year-old conservative judge.
Alaska’s Lisa Murkowski, the only Republican to oppose the nominee, voted “present”, offsetting the absence of Kavanaugh supporter Steve Daines of Montana, who was attending his daughter’s wedding.
The rare procedural manoeuvre left Mr Kavanaugh with the same two-vote margin he would have had if Ms Murkowski and Mr Daines had both voted.
Republicans hold only a 51-49 Senate majority and therefore had little support to spare.
It was the closest roll call to confirm a justice since 1881, when Stanley Matthews was approved by 24-23, according to Senate records.
Democrats say Mr Kavanaugh will push the court too far, including possible sympathetic rulings for President Trump should he encounter legal problems from the special counsel’s investigations into Russian connections with his 2016 presidential campaign.
And they said Mr Kavanaugh’s record and testimony at a now-famous Senate Judiciary Committee hearing showed he lacked the fairness, temperament and even honesty to become a justice.
But the fight was defined by the sexual assault accusations. And it was fought against the backdrop of the #MeToo movement and President Trump’s unyielding support of his nominee and occasional mocking of Mr Kavanaugh’s accusers.