The foreign secretary has branded as "ridiculous" a UN panel's ruling that Julian Assange be allowed to go free, as the Wikileaks founder demanded the decision be respected.
Mr Assange — who faces extradition to Sweden over a rape claim, which he denies — claimed asylum in London's Ecuadorean embassy in 2012.
The panel said he had been "arbitrarily detained" and should get compensation.
Philip Hammond rejected the decision, accusing Mr Assange of evading justice.
Mr Assange hailed it a "significant victory" and called the decision "binding", but the UK government dismissed this.
The 44-year-old Australian was originally arrested in London in 2010 under a European Arrest Warrant issued by Sweden over rape and sexual assault allegations.
Two years later, while on bail, he claimed asylum inside the Ecuadorean embassy in Knightsbridge.
Swedish prosecutors dropped an investigation into two sex assault claims against Mr Assange last year after running out of time to question him. However, he still faces the more serious accusation of rape.
'Brought a smile'
Reading a statement via a video link from the embassy, he said the opinion of the panel was "vindication", adding: "The lawfulness of my detention is now a matter of settled law."
Mr Assange said it was a "really significant victory that has brought a smile to my face".
However, Mr Hammond said Mr Assange was a "fugitive from justice", adding that he can come out "any time he chooses" but will still have to face justice in Sweden.
Anders Ronquist, legal chief at Sweden's foreign ministry, said: Mr Assange "is not being deprived of his liberty there due to any decision or action taken by the Swedish authorities".'
Mr Assange said the comments by Mr Hammond were "beneath" the minister's stature and "insulting" to the UN, while Ecuador's foreign minister criticised the UK for rejecting the panel's decision.
Ricardo Patiño said the UK had violated "important articles of the Universal Human Rights Convention and of the International Treaty on Political and Civil rights".
What next for Julian Assange?
The UK Foreign Office said the report "changes nothing" and it will "formally contest the working group's opinion".
The government said while a European Arrest Warrant remained in place the UK continued to have a legal obligation to extradite Mr Assange.
But the whistleblower Edward Snowden, who is accused of espionage in the US and has received legal support from Wikileaks, tweeted that the UK and Sweden's response to the panel's decision "writes a pass for every dictatorship to reject UN rulings".
Mr Assange read a statement to the media via a video link
In September 2014, Mr Assange complained to the UN that he was being "arbitrarily detained" as he could not leave without being arrested.
The complaint against the UK and Sweden claimed Mr Assange had been deprived of his liberty for an "unacceptable length of time".
The UN's Working Group on Arbitrary Detention insisted Mr Assange's detention "should be brought to an end, that his physical integrity and freedom of movement be respected".
The Wikileaks founder had been subjected to "different forms of deprivation of liberty" it said, initially while he was held in isolation at London's Wandsworth Prison for 10 days in 2010.
The deprivation had been "continuous" since he was initially arrested in the UK on 7 December 2010.
"Mr Assange should be afforded the right to compensation," it added.
Three members of the five-person panel found in Mr Assange's favour, while one rejected his claim and another did not take part in the investigation.
The UK's permanent representative to the UN Julian Braithwaite has written to the panel expressing the government's surprise and disappointment with the outcome.
In a statement posted on Twitter on Thursday, Mr Assange said his passport should be returned and his arrest warrant dropped if the UN panel ruled in his favour.
In September 2014, Mr Assange complained to the UN that he was being "arbitrarily detained" as he could not leave without being arrested.
The complaint against the UK and Sweden claimed Mr Assange had been deprived of his liberty for an "unacceptable length of time".
The UN's Working Group on Arbitrary Detention insisted Mr Assange's detention "should be brought to an end, that his physical integrity and freedom of movement be respected".
The Wikileaks founder had been subjected to "different forms of deprivation of liberty" it said, initially while he was held in isolation at London's Wandsworth Prison for 10 days in 2010.
The deprivation had been "continuous" since he was initially arrested in the UK on 7 December 2010.
"Mr Assange should be afforded the right to compensation," it added.
Three members of the five-person panel found in Mr Assange's favour, while one rejected his claim and another did not take part in the investigation.
The UK's permanent representative to the UN Julian Braithwaite has written to the panel expressing the government's surprise and disappointment with the outcome.
In a statement posted on Twitter on Thursday, Mr Assange said his passport should be returned and his arrest warrant dropped if the UN panel ruled in his favour.
Analysis
By Caroline Hawley, BBC diplomatic correspondent
Julian Assange and his supporters will see this as a significant moral victory.
The Wikileaks founder, who walked into the Ecuadorean Embassy after losing a series of appeals in British courts, now has an important panel of UN legal experts on his side.
Legally binding or not, a UN official said the decision was based on international law.
Although both Britain and Sweden are firmly sticking to their guns, they are now in an extremely awkward position. The Swedish government has seized on the dissenting voice in the panel — who argued, as Britain does, that Mr Assange fled bail and was using the Ecuadorean embassy to evade arrest.
The call for compensation for Mr Assange is particularly controversial when there is already public anger in the UK over the cost of policing his confinement at the embassy.
What does the UN panel do?
The UN's Working Group on Arbitrary Detention is made up of five legal experts from around the world.
Established in 1991, it has made hundreds of rulings on whether imprisonment or detention is lawful.
High profile complainants include Washington Post journalist Jason Rezaian, who was released in Iran last month.
It also offered an opinion on former pro-democracy President Mohamed Nasheed, released in the Maldives last year, and Myanmar party leader, Aung San Suu Kyi.