SYDNEY/LONDON (Reuters) -- WikiLeaks founder Julian Assange's three-and-a-half-year stay in the Ecuadorian embassy in London amounts to 'unlawful detention', a United Nations panel examining his appeal will rule on Friday, the BBC reported.

Assange, a former computer hacker who has been holed up in the embassy since June 2012, told the U.N. Working Group on Arbitrary Detention that he was a political refugee whose rights had been infringed by being unable to take up asylum in Ecuador.

WikiLeaks founder Julian Assange makes a speech from the balcony of the Ecuadorian Embassy, in central London, Britain February 5, 2016. REUTERS/Peter Nicholls/Files

A supporter of Wikileaks founder Julian Assange holds a banner outside the Ecuadorian embassy in London as he marks three years since Assange claimed asylum in the embassy on June 19, 2015. WikiLeaks founder Julian Assange clocks up three years inside the Ecuadoran embassy in London today, after claiming that Swedish prosecutors cancelled a landmark meeting in his case earlier this week. AFP PHOTO / JUSTIN TALLIS (Photo credit should read JUSTIN TALLIS/AFP/Getty Images)

A supporter of Wikileaks founder Julian Assange holds banners outside the Ecuadorian embassy in London as he marks three years since Assange claimed asylum in the embassy on June 19, 2015. WikiLeaks founder Julian Assange clocks up three years inside the Ecuadoran embassy in London today, after claiming that Swedish prosecutors cancelled a landmark meeting in his case earlier this week.
AFP PHOTO / JUSTIN TALLIS (Photo credit should read JUSTIN TALLIS/AFP/Getty Images)

Julian Assange, Founder and Editor-in-Chief of WikiLeaks speaks via video link during a press conference on the occasion of the ten year anniversary celebration of WikiLeaks in Berlin, Germany, October 4, 2016. REUTERS/Axel Schmidt TPX IMAGES OF THE DAY

WikiLeaks founder Julian Assange appears on screen via video link during his participation as a guest panelist in an International Seminar on the 60th anniversary of the college of Journalists of Chile in Santiago, Chile, July 12, 2016. REUTERS/Rodrigo Garrido

File photo dated 05/02/16 of WikiLeaks founder Julian Assange, who will publish more confidential documents on the US Central Intelligence Agency once a "key attack code" has been disarmed, he has revealed.

File photo dated 5/2/2016 of Julian Assange who has defended the release of emails by WikiLeaks about US presidential candidate Hillary Clinton.

WikiLeaks founder Julian Assange speaking from the balcony of the Ecuadorian Embassy in London where he has been living for more than three years after the country granted him political asylum.

The Spanish journalist Ignacio Ramonet presents in Quito, Ecuador, on June 23, 2016 the Ecuador 's book " When Google found Wikileaks". Julian Assange made his appearance to the world in 2010 with the publication by WikiLeaks of thousands of secret documents revealing conspiracies , corruption, crimes , lies, and incriminate several governments and particularly the United States as the main actor illegalities. (Photo by Rafael Rodrï¿½uez/ACGPHOTO/NurPhoto via Getty Images)

LONDON, ENGLAND - FEBRUARY 05: Wikileaks founder Julian Assange prepares to speak from the balcony of the Ecuadorian embassy where he continues to seek asylum following an extradition request from Sweden in 2012, on February 5, 2016 in London, England. The United Nations Working Group on Arbitrary Detention has insisted that Mr Assange's detention should be brought to an end. (Photo by Carl Court/Getty Images)

LONDON, ENGLAND - FEBRUARY 05: A panel of WikiLeaks representitives and press look on as WikiLeaks founder Julian Assange speaks at a press conference at the Frontline Club via video link from the Ecuadorian Embassy in London on 5 February 2016 in London, England. Mr Assange's speech comes a day after it was announced that the UN panel ruled he was being unlawfully detained at the Ecuadorian Embassy. (Photo by Chris Ratcliffe/Getty Images)

Australian founder of whistleblowing website, 'WikiLeaks', Julian Assange speaks to media after giving a press conference in London on July 26, 2010. The founder of a website which published tens of thousands of leaked military files about the war in Afghanistan said Monday they showed that the 'course of the war needs to change'. In all, some 92,000 documents dating back to 2004 were released by the whistleblowers' website Wikileaks to the New York Times, Britain's Guardian newspaper, and Germany's Der Spiegel news weekly. Assange also used a press conference in London to dismiss the White House's furious reaction to the disclosures. AFP PHOTO/Leon Neal (Photo credit should read LEON NEAL/AFP/Getty Images)

Reuters was unable immediately to confirm the BBC report and the UN said the panel's opinion, which is not legally binding, was due to be published on Friday.

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

It said Assange will be arrested if he leaves the embassy and then extradited to Sweden for questioning over allegations of rape in 2010. Assange denies the rape allegations.

"Should the U.N. announce tomorrow that I have lost my case against the United Kingdom and Sweden, I shall exit the embassy at noon on Friday to accept arrest by British police as there is no meaningful prospect of further appeal," Assange said in a statement posted on the Wikileaks Twitter account.

"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."

A decision in his favor would mark the latest twist in a tumultuous journey for Assange since he incensed the United States and its allies by using his WikiLeaks website to leak hundreds of thousands of secret U.S. diplomatic and military cables in 2010, disclosures that often embarrassed Washington.

Assange, 44, fears Sweden will extradite him to the United States, where he could be put on trial over WikiLeaks' publication of the classified military and diplomatic documents, one of the largest information leaks in U.S. history.

He made international headlines in early 2010 when WikiLeaks published classified U.S. 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 U.S.-led military campaign in Afghanistan, followed by almost 400,000 internal U.S. military reports detailing operations in Iraq.

Those disclosures were followed by the release of more than 250,000 classified cables from U.S. embassies. It would go on to add almost three million more diplomatic cables dating back to 1973.

POLITICAL REFUGEE?

In his submission to the U.N. working group, a body of outside experts, Assange argued that his time in the embassy constituted arbitrary detention.

Assange says he is the victim of a witch hunt directed by the United States and that his fate is a test case for freedom of expression.

He said that he had been deprived of his fundamental liberties, including lack of access to sunlight or fresh air, adequate medical facilities, as well as legal and procedural insecurity.

"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.

Per Samuelson, one of Assange's Swedish lawyers, said if the U.N. panel judged Assange's time in the embassy to be custody, he should be released immediately.

"It is a very important body that would be then saying that Sweden's actions are inconsistent with the European Convention on Human Rights. And it is international common practice to follow those decisions," Samuelson told Reuters.

Since Assange's confinement, WikiLeaks has continued to publish documents on topics such as the Trans-Pacific Partnership, one of the world's biggest multinational trade deals, which was signed by 12 member nations on Thursday in New Zealand.