Julian Assange must be freed from “arbitrary detention” by the UK and Sweden, the United Nations has ruled.
The UN Working Group on Arbitrary Detention said called on Swedish and British authorities to immediately end the WikiLeaks founder's “deprivation of liberty'' and compensate him.
Its findings were leaked by sources on Thursday but the official ruling was not released until Friday morning.
The UK Government is formally contesting the findings and denied that his "voluntary" stay at the Ecuadorian Embassy constituted arbitrary detention.
But Mr Assange said he expects the “immediate return” of his passport and a stop to further attempts to arrest him.
Swedish prosecutors want to question him over allegations of rape stemming from a working visit he made to the country in 2010, when revelations made by WikiLeaks on the Iraq and Afghanistan wars were reverberating around the world.
Mr Assange has consistently denied the allegations but refused to return to Sweden and eventually sought refuge in the Ecuadorean embassy in London, where he has lived since June 2012.
Making its ruling on his case, the UN’s Working Group on Arbitrary Detention (WGAD) found the WikiLeaks founder had been “arbitrarily detained by the Governments of Sweden and the United Kingdom of Great Britain and Northern Ireland”.
The group said he was entitled to freedom of movement and an unspecified amount of compensation.
“Having concluded that there was a continuous deprivation of liberty, the Working Group also found that the detention was arbitrary because he was held in isolation during the first stage of detention and because of the lack of diligence by the Swedish Prosecutor in its investigations, which resulted in the lengthy detention of Mr Assange,” it said in a statement.
“The Working Group therefore requested Sweden and the United Kingdom to assess the situation of Mr Assange to ensure his safety and physical integrity, to facilitate the exercise of his right to freedom of movement in an expedient manner, and to ensure the full enjoyment of his rights guaranteed by the international norms on detention.”
The panel representative from Australia did not participate in the deliberations and an unidentified member disagreed with the ruling and argued that Mr Assange’s situation does not constitute detention and so falls outside of its mandate.
Video: Assange speaks from Ecuadorian embassy
On Thursday, Mr Assange said he would leave the Embassy if the panel ruled against him and accept arrest by British police.
“However, should I prevail and the state parties be found to have acted unlawfully, I expect the immediate return of my passport and the termination of further attempts to arrest me,” he said in a statement.
The Australian fears Sweden will extradite him to authorities in the US where he could be put on trial over the activities of the WikiLeaks website, which has published thousands of classified military and diplomatic documents.
As the Swedish investigation continued in December 2010, Mr Assange was jailed in Wandsworth Prison in isolation for 10 days and then put under house arrest for 550 days under powers granted by an international arrest warrant.
The Republic of Ecuador granted him asylum but Mr Assange has not felt able to leave its embassy, and endured “extensive surveillance by the British police”, the WGAD said.
In pictures: Julian Assange's 'arbitrary detention'
In pictures: Julian Assange's 'arbitrary detention'
1/14 In pictures: Assange's 'arbitrary detention'
Wikileaks founder Julian Assange speaks from the Ecuadorian Embassy on December 20, 2012 in London, England.
2/14 In pictures: Assange's 'arbitrary detention'
Supporters of Julian Assange show banners as they wait for his appearance opposite the Ecuadorian Embassy yesterday (Frank Augstein/AP)
3/14 In pictures: Assange's 'arbitrary detention'
A supporter of WikiLeaks founder Julian Assange demonstrates outside Ecuador's embassy in central London on February 5, 2016
4/14 In pictures: Assange's 'arbitrary detention'
Assange speaking to the media outside the Ecuador embassy in 2012
5/14 In pictures: Assange's 'arbitrary detention'
Fashion designer and political activist Vivienne Westwood to visit Wikileaks founder Julian Assange
6/14 In pictures: Assange's 'arbitrary detention'
Members of the media wait outside the Ecuadorian embassy where Wikileaks founder Julian Assange continues to seek asylum in February 2016.
7/14 In pictures: Assange's 'arbitrary detention'
Supporters of Assange wait for the arriveal of Ecuadorian Foreign minister Ricardo Patino (Andrew Cowie/AFP/Getty Images)
8/14 In pictures: Assange's 'arbitrary detention'
A supporter outside the embassy, which is guarded by police. The 24-hour operation is said to have cost the British taxpayer £3 million (Tal Cohen/EPA)
9/14 In pictures: Assange's 'arbitrary detention'
Supporters of the WikiLeaks founder Julian Assange at a protest outside the Ecuadorean embassy yesterday, where he has been holed up for three years
10/14 In pictures: Assange's 'arbitrary detention'
Supporters have appeared at the embassy numerous times over the last year, especially when Mr Assange is set to appear, as he did yesterday (Frank Augstein/AP)
11/14 In pictures: Assange's 'arbitrary detention'
The Foreign & Commonwealth Office have made clear that: “The UK has a legal obligation to extradite Mr Assange to Sweden” (Chris Helgren/Reuters)
12/14 In pictures: Assange's 'arbitrary detention'
Demonstrators hold banners outside the Ecuadorean Embassy in London, where Wikileaks founder Julian Assange is staying
13/14 In pictures: Assange's 'arbitrary detention'
14/14 In pictures: Assange's 'arbitrary detention'
Scotland Yard stood down the 24/7 police presence outside the building in October last year but pledged to make “every effort” to arrest Mr Assange if he left.
The UN panel found that his situation violates articles nine and 10 of the UN Declaration of Human Rights, which stipulate that “no one shall be subjected to arbitrary arrest, detention or exile” and grants people “full equality to a fair and public hearing by an independent and impartial tribunal” to hear criminal charges.
Mr Assange was also found to have been held in violation of articles seven, nine, 10 and 14 of the International Covenant on Civil and Political Rights.
The findings were sent to the British and Swedish governments on 22 January but are not legally binding.
“The statement from the Working Group has no formal impact on the ongoing investigation, according to Swedish law,” said Karin Rosander, spokeswoman for Sweden's Prosecution Authority.
Additional reporting by AP