The WikiLeaks founder has been in the Ecuadorian embassy since 2012
Sweden's foreign ministry has said a United Nations (UN) report concludes that Julian Assange has been "arbitrarily detained" in a London embassy.
Ministry spokeswoman Katarina Byrenius Roslund said: "Their working group has made the judgement that Assange has been arbitrarily detained in contravention of international commitments."
The WikiLeaks founder (44) has been holed up in the Ecuadorian embassy in west London since June 2012 - and has been granted political asylum by the Ecuador government.
Swedish prosecutors want to question him over allegations of sexual assault against two women in 2010. He denies the allegations.
On Thursday, he had said he would leave the embassy after more than three years if he lost his legal appeal to the UN.
The Australian had filed a complaint against Sweden and the UK in September 2014, which was being considered by the UN Working Group on Arbitrary Detention.
Mr Assange claims if he went to Sweden he could be handed over to US authorities for prosecution over the disclosure of secret cables by WikiLeaks.
Vaughan Smith, a friend of Mr Assange, said he was "delighted" by the UN decision.
He said: "He has appealed to the highest authority available to him and they have come out in his favour completely, and I'm delighted that the Swedish government have recognised this and hopefully they'll drop the case and Julian will be able to go to Ecuador or wherever he likes".
"We have failed shamefully in our human rights, in our treatment of this person. I think to disregard that sends a terrible message".
"How are we going to hold our head high as a country that considers itself to be full of fair and decent people if we're not prepared to respect rafts of human rights legislation".