Image copyright Getty Images Image caption Julian Assange has been holed up at the Ecuadorian embassy in London since 2012
Assange’s fiancee has vowed that the WikiLeaks founder’s fight to remain in the UK will go on.
Miriam Ekstam was in court when an appeal by the UK government to extradite Assange to Sweden for questioning about alleged sexual offences was rejected.
Assange, 44, sought asylum at the Ecuadorian embassy in 2012 to avoid extradition.
Judges dismissed the government’s application on Monday, ruling the initial decision by a London judge to allow the Swedish extradition to proceed “is not unlawful”.
Ms Ekstam, who was with Assange in the audience, said she was “confident that the decision will be overturned”.
“We believe that extradition to Sweden will not be the final decision, because we know he would be extradited to the US where it’s likely that he will face the death penalty,” she told reporters outside court.
The appeal had come to a “heads of agreement” with Assange, she added.
Mr Assange has denied all sexual offences against two women while he was visiting Sweden in 2010.
He argued he was not entitled to avoid extradition unless “the Swedish case is withdrawn or quashed by the UK courts”, for which he would have to make a final application.
‘For the safety of my daughter’
Image copyright Getty Images Image caption Assange says he fears being handed over to the US
In a statement on Twitter, he said he hoped the appeal court decision meant “Ecuador can take swift and decisive action to stop British authorities threatening my safety”.
Foreign Secretary Boris Johnson said the judge’s initial decision was “worrying” and Mr Assange’s argument “materially flawed”.
Two of three High Court judges in London, Sir David Eady and Lord Justice Moylan, ruled in favour of the government.
Lord Justice Moylan said the decision to allow Mr Assange to remain at the embassy “under any circumstances” was “unfounded”.
With the appeal now exhausted, the government could simply arrest Assange if he left the building and extradite him to Sweden.
Another appeal to the European Court of Human Rights is also due to be heard in March.
Helen Lewis, a London-based expert in legal and human rights law at Goldsmiths, University of London, told the BBC that this latest ruling could take three to four weeks to be appealed.
This is just the first step of what is expected to be a series of High Court challenges from the government to Mr Assange.
Ms Lewis said Mr Assange’s next step would depend on how his QC, Jonathan Goldberg QC, sets out his case at the appeal court and what his lawyers suggest he is willing to give up in return for dismissal of the case.
Julian Assange: 44-year-old former computer hacker and journalist
On the run since 2010, Assange remains holed up in Ecuador’s embassy in London, seeking asylum.
Earlier this month, when he was given 24-hour police protection after a letter from Mrs Clinton’s campaign chairman, he told the BBC: “I think I’ll remain at the embassy for a very long time.”
Mrs Clinton was criticised in September for urging supporters to vote for “the most vile, hateful, bigoted, false, impugned person” as US President Donald Trump’s successor in the election.
Assange’s last “escape bid”
In November 2010, Assange and a computer expert, Daniel Domscheit-Berg, made the decision to stop working together, which was alleged by Mr Domscheit-Berg to be because of the WikiLeaks founder’s dislike of the German’s control of access to certain media sources.
The pair split in June that year.
To avoid detection, Assange took up residency at the Ecuadorian embassy. He gained British citizenship in August 2010.
Image copyright Getty Images Image caption Jane Logan and Suzanne Cole with their two sons; Sam, 12, and Charlie, 10
Meanwhile, Operation Hermitage – the name given to the investigation into Mr Assange’s alleged sexual misdemeanours – continued.
The Foreign Office had tried to arrest him on a European Arrest Warrant issued by Swedish authorities.
Assange was granted asylum by Ecuador in June 2012, under what the state-run media said was a “request for protection, political asylum, in connection with, inter alia, political persecution, threats and abuse of rights”.
Image copyright Reuters Image caption Computer hacker and Wikileaks founder Assange pictured with his partner, Victoria, and their two sons, aged six and two
An encrypted email reportedly between two diplomatic staff – but not believed to be Assange – said he had requested diplomatic protection.
With no alternative arrangement in place for