WikiLeaks founder Julian Assange can be extradited to Sweden to face sex crime allegations, the Supreme Court has ruled.
Seven Supreme Court judges gave their judgment in a move that could end his marathon battle through the UK courts.
Assange was not in court to hear the ruling because he was stuck in traffic.
Lawyers for the WikiLeaks boss had argued that the European arrest warrant issued against him is "invalid and unenforceable".
The Swedish authorities want Assange, 40, to answer accusations of raping one woman and sexually molesting and coercing another in Stockholm in August 2010.
Assange, whose website has published a mass of diplomatic cables that have embarrassed several governments, insists the sex was consensual and that the allegations against him are politically motivated.
In November 2011, the High Court upheld a ruling that the Australian computer expert should be extradited to face investigation.
But in the Supreme Court, his QC Dinah Rose claimed the Swedish public prosecutor who signed the arrest warrant could not issue a valid document because she lacked impartiality and independence.
She said it raised the single issue of law about whether the Swedish public prosecutor constituted a "judicial authority" capable of issuing a valid warrant under the provisions of the 2003 Extradition Act.
It was common ground that if she did not, there was no legal basis for extradition.
Ms Rose suggested it was obvious that a public prosecutor whose function it was to investigate and prosecute an individual "cannot exercise judicial authority in relation to that individual".
As a matter of fundamental legal principle dating back hundreds of years, a judicial authority had to be impartial and independent both of the executive and the parties in a case.
Clare Montgomery QC, for the Swedish Prosecution Authority, argued that the High Court was right to accept that the term "judicial authority" had a wide and autonomous meaning, and it was not restricted in this.
Since the start of the European arrest warrant (EAW) scheme, it had been the practice of a number of prominent member states to issue EAWs through public prosecutors.
Ms Montgomery argued: "There is no conceivable breach of fundamental rights involved in such a process."
Lord Phillips, president of the Supreme Court, said the point of law had not been simple to resolve but the court ultimately dismissed the appeal by a majority of five to two.
The court held that an EAW issued by a public prosecutor is a valid warrant issued by a judicial authority within the meaning of the 2003 Act.
Lady Hale and Lord Mance dissented.
Following the ruling, Ms Rose said an application would be made to reopen the case at the Supreme Court on the basis that the court's majority decision was made on legal points not argued during the appeal.
Assange was given 14 days to consider the ruling before a final decision on his next step in his legal battle.
Once his avenues in Britain are exhausted, he could mount a final challenge through the European Court of Human Rights.