The US Senate has voted to confirm President Donald Trump’s nominee for the Supreme Court, after weeks of rancorous debate.
The Senate backed Brett Kavanaugh’s nomination by 50 votes to 48.
Mr Kavanaugh had been embroiled in a bitter battle to stave off allegations of sexual assault.
But after an 11th-hour investigation by the FBI into the allegations, enough wavering senators decided to back the nomination.
Ahead of the vote, hundreds of people protesting against Mr Kavanaugh’s nomination demonstrated at the US Capitol in Washington.
During the vote, other protesters shouted “shame” from the public gallery and Vice-President Mike Pence had to call for order to be restored.
Mr Kavanaugh’s appointment is for life and he will strengthen conservative control of the nine-judge court, which has the final say on US law.
Mr Trump sent out a tweet of congratulations:
So what were the numbers in the Senate?
The upper house is split 51-49 in favour of the Republicans and the vote was largely along party lines. Mr Kavanaugh actually only needed a 50-50 vote, as that would have forced a tie-breaker in his favour from Mr Pence.
In the end, there was a two-vote margin.
The only party dissenters were Republican Senator Lisa Murkowski, who had intended to vote no, and Democrat Joe Manchin, who voted yes.
That should have meant a 51-49 tally, but the absence of Republican Steve Daines, a yes voter who was at his daughter’s wedding, altered the final tally.
Ms Murkowski opted instead to simply mark herself as “present”, leaving the final vote 50-48.
Although Ms Murkowski had said Mr Kavanaugh was a “good man”, she also said he was “not the right person for the court at this time” and his “appearance of impropriety has become unavoidable”.
Joe Manchin is facing a difficult re-election campaign in West Virginia, a traditionally Republican state that Mr Trump won by a landslide. He said he “found Judge Kavanaugh to be a qualified jurist”.
There were shouts of “shame” from the public gallery as he voted yes.
Two Republican waverers, Susan Collins and Jeff Flake, finally decided to back the judge.
Analysis: Just the beginning
By Anthony Zurcher, BBC North America reporter
Brett Kavanaugh’s confirmation to the Supreme Court has been decided. The political war, however, is just beginning.
Donald Trump’s court pick generated a controversy that captured the nation’s attention in a way that few political issues do. It generated daily headlines rivalled only by the US quadrennial presidential elections.
Now that the bombs have been thrown, it’s time to assess the fallout.
Why is the court so important?
Basically, it’s the final arbiter of US law.
It has the ultimate say on such contentious issues as abortion and gun control.
The Democrats are still smarting from the previous Supreme Court appointment. Republicans last year successfully stalled the process, meaning it fell to Mr Trump, not Barack Obama, to nominate the new justice. Mr Trump’s choice of Neil Gorsuch strengthened the conservative leaning.
All eyes will now be on November’s mid-term elections. Mr Trump will be able to campaign on the back of an important victory, but commentators will be watching closely how the Kavanaugh affair affects women voters.