Julian Assange has lost another court bid to have his UK arrest warrant dropped.
The WikiLeaks founder faces arrest if he leaves the Ecuadorian Embassy in London, where he has been holed up for five and a half years.
Last week, District Judge Emma Arbuthnot rejected an initial bid to have the warrant withdrawn, saying it remains valid because he skipped bail in June 2012.
Mr Assange had first challenged the warrant on the grounds that police in Sweden no longer want him extradited for questioning over rape allegations.
In the latest bid to have the warrant dropped, lawyers had asked a London court to consider whether it was in the public interest for the WikiLeaks founder to be arrested.
They highlighted five grounds, including a UN expert panel finding that Mr Assange had been "arbitrarily detained by Sweden and the UK".
Ruling against Mr Assange, Judge Arbuthnot said "it is certainly not against the public interest to proceed".
She said: "On the one hand he is a man who has failed to attend court and has thwarted the course of justice but on the other he has been unable to leave a small flat for a number of years and is suffering physically and mentally as a result."
However, she also argued: "I find arrest is a proportionate response even though Mr Assange has restricted his own freedom for a number of years. Defendants on bail up and down the country, and requested persons facing extradition, come to court to face the consequences of their own choices. He should have the courage to do so too."
The judge added: "The impression I have, and this may well be dispelled if and when Mr Assange finally appears in court, is that he is a man who wants to impose his terms on the course of justice."
"We are surprised"
In a statement posted on Twitter, Mr Assange said: "We are surprised. The judge went outside what the parties presented in court. This seems to have led to the significant factual errors in the judgment.
"US [Department of Justice] confirmed to Reuters again yesterday that its case is ongoing. There are three months to appeal UK ruling."
Mr Assange has always denied the sexual assault allegations against him, and Swedish prosecutors dropped the case last year saying all possible leads had been "exhausted".
He was granted political asylum by Ecuador in 2012 amid fears he would be extradited to the United States if he is arrested in the UK.
Mr Assange - whose organisation has published confidential documents relating to the US intelligence services - is the subject of a "very serious criminal investigation" in the US, officials have previously admitted.
It remains unclear if a US extradition warrant against Mr Assange exists.