WikiLeaks founder Julian Assange will demand he be allowed to leave the Ecuadorian embassy in London a free man, after a UN panel ruled he was detained arbitrarily there.

Mr Assange, who enraged the United States by publishing hundreds of thousands of secret US diplomatic cables, has been holed up in the embassy since 2012 to avoid a rape investigation.

Mr Assange appealed to the UN panel, saying he was a political refugee whose rights had been infringed by being unable to take up asylum in Ecuador.

The panel of five independent experts ruled in Mr Assange's favour today and called on both Sweden and Britain to compensate him.

Julian Assange in the Ecuadorian embassy

"WikiLeaks founder Julian Assange has been arbitrarily detained by Sweden and the United Kingdom since his arrest in London on 7 December 2010," the United Nations Working Group on Arbitrary Detention said.

The panel said Mr Assange's situation "should be brought to an end, that his physical integrity and freedom of movement be respected, and that he should be entitled to an enforceable right to compensation".

The former computer hacker denies allegations of a 2010 rape in Sweden, saying the charge is a ploy that would eventually take him to the United States where a criminal investigation into the activities of WikiLeaks is still open.

Ecuador said Britain and Sweden must allow Mr Assange to walk free from its London embassy.

"It is time for both governments (Britain and Sweden) to correct their mistake, time for them to allow Julian Assange his freedom, time for them to end this arbitrary detention and furthermore compensate the damage done to this man," Ecuador's Foreign Minister Ricardo Patino told a press conference.

Speaking at a press conference this afternoon via video link from the Ecuadorian Embassy, Mr Assange said he felt vindicated by the findings.

Britain said it had never arbitrarily detained Mr Assange and that the Australian had voluntarily avoided arrest by jumping bail to flee to the embassy.

Both Sweden and Britain said they would not be bound by the panel's ruling.

"This changes nothing," a British government spokesman said.

Media gather outside the  Ecuadorian embassy in London

"We completely reject any claim that Julian Assange is a victim of arbitrary detention. The UK has already made clear to the UN that we will formally contest the working group's opinion.
              
"He is, in fact, voluntarily avoiding lawful arrest by choosing to remain in the Ecuadorian embassy," the spokesman said.

"An allegation of rape is still outstanding and a European arrest warrant in place, so the UK continues to have a legal obligation to extradite him to Sweden."

But Mr Assange, 44, said in a short statement posted on Twitter before the ruling: "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 had said that if he lost the appeal then he would leave his cramped quarters at the embassy in the Knightsbridge area of London.

The decision in his favour marks the latest twist in a tumultuous journey for Mr Assange since he incensed Washington with his leaks that laid bare often highly-critical US appraisals of world leaders from Vladimir Putin to the Saudi royal family.

While the ruling may draw attention to Mr Assange's fate, it is unlikely to immediately affect the current investigations against him.

The UN Working Group does not have the authority to order the release of a detainee, but it has considered many high-profile cases and its backing carries a moral weight that puts pressure on governments.

Recent high-profile cases submitted to the UN panel include that of jailed former Maldives President Mohamed Nasheed and of Washington Post reporter Jason Rezaian, an Iranian-American jailed in Iran until a prisoner swap last month.

But governments have frequently brushed aside its findings such as a ruling on Myanmar's house arrest of opposition leader Aung San Suu Kyi in 2008, a call in 2008 for the Iraqi government not to hang former dictator Saddam Hussein, and frequent pleas for the closure of the US military prison at Guantanamo Bay.

"We have been consistently clear that Mr Assange has never been arbitrarily detained by the UK but is, in fact, voluntarily avoiding lawful arrest by choosing to remain in the Ecuadorian embassy," a British government spokeswoman said.Protestors outside the Ecuadorian EmbassySwedish prosecutors said the UN decision had no formal impact on the rape investigation under Swedish law.

A US Grand Jury investigation into WikiLeaks is ongoing.

White House spokesman Josh Earnest said it was unclear what impact "a pronouncement from the United Nations would have on the situation".

"But, you know, but he's facing serious charges inside of Sweden," Mr Earnest said.

Mr Assange said that he had been deprived of fundamental liberties including access to sunlight and fresh air, adequate medical facilities and legal and procedural security.

Since he sought refuge in the small embassy, British media have reported Mr Assange has suffered from an irregular heartbeat, a chronic cough and high blood pressure.

Mr Assange made international headlines in early 2010 when WikiLeaks published classified US military video showing a2007 attack by Apache helicopters that killed a dozen people in Baghdad, including two Reuters news staff.

Later that year, the group released over 90,000 secret documents detailing the US-led military campaign in Afghanistan, followed by almost 400,000 internal US military reports detailing operations in Iraq.

More than 250,000 classified cables from US embassies followed and then almost three million were released dating back to 1973.