WikiLeaks founder Julian Assange has been subject to 'arbitrary detention' during the 3-1/2 years he has spent in the Ecuadorian embassy in London to avoid a rape investigation in Sweden, a UN panel will rule tomorrow.

Mr Assange, who enraged the United States by publishing hundreds of thousands of secret US diplomatic cables, appealed to the panel saying he was a political refugee whose rights had been infringed by being unable to take up asylum in Ecuador.

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 US where a criminal investigation into the activities of WikiLeaks is still open.

His leaks laid bare often highly critical US appraisals of world leaders from Vladimir Putin to the Saudi royal family.

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

But the United Nations Working Group on Arbitrary Detention ruled in Mr Assange's favour, Sweden said.

"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," Mr Assange, 44, said in a short statement posted on Twitter.

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, though Britain said he would be arrested and extradited to Sweden as soon as he stepped outside.

Mr Assange made international headlines in early 2010 when WikiLeaks published classified US military video showing a 2007 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, then almost three million dating back to 1973.

In his submission to the UN working group, which is due to publish its findings tomorrow, Mr Assange argued that his time in the embassy constituted arbitrary detention.

"(The) working group has made the judgment that Assange has been arbitrarily detained in contravention of international commitments," a spokeswoman for the Swedish Foreign Ministry said, confirming an earlier report by the BBC.

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

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

"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 Ecuadorean embassy," a British government spokeswoman 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 Mr Assange to Sweden," she said.

Swedish 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 the impact "a pronouncement from the United Nations would have on the situation".

"But, you know, but he's facing serious charges inside of Sweden. Sweden has asked the British for extradition, and ultimately those two countries will have to resolve the situation," Mr Earnest said.