A United Nations human rights panel has concluded that Julian Assange is being arbitrarily detained in London in violation of international law.
However, the decision, to be published on Friday by the UN's Working Group on Arbitrary Detention, is not binding in Britain.
And the Foreign Office said Britain is still legally obliged to extradite Assange to Sweden.
Assange, 44, has said he will use the decision – which is an influential opinion based on international and domestic law – to push for the return of his passport and a guarantee that he is no longer subject to arrest.
But he is unlikely to leave the Ecuadorian embassy and risk arrest until these conditions are met.
There is a warrant for the arrest of Assange, after he sought asylum at the embassy in 2012 to avoid extradition to Sweden over sexual assault allegations.
British police said "if he leaves the embassy we will make every effort to arrest him".
Though police last year ended their 24/7 visible guard outside the embassy, they have covert surveillance in case he tries to leave.
Assange says he fears the Sweden extradition would be followed by extradition to the US to face espionage charges over his work with WikiLeaks.
The Geneva-based UN group was due to publish the findings of its investigation on Friday evening, Australian time. It made its decision several weeks ago and informed the countries involved in the case, including Britain and Sweden.
On Thursday the BBC reported the decision was in Assange's favour. Fairfax Media, publisher of this website, also understands this is the case.
Sweden's foreign ministry confirmed it to the New York Times. A spokeswoman added "we note that the Working Group's view differs from that of the Swedish authorities", and the office of the country's director of public prosecutions said their stance would not change as a result of the decision.
Earlier on Thursday Assange tweeted that "should the UN announce that I have lost my case … I shall exit the embassy at noon on Friday to accept arrest".
However, if the decision was in his favour "I expect the immediate return of my passport and the termination of further attempts to arrest me", he said.
On Wednesday Assange's lawyer Melinda Taylor told Fairfax Media that Assange's physical departure from the embassy would depend on the British government promising him safe passage to Ecuador.
"[There remains] the risk of potential extradition to the United States, where he is likely to be subjected to persecution or cruel and inhumane treatment due to his whistleblowing activities," she said.
Assange's lawyers had argued that their client's apparent freedom to walk out of the embassy at any time was "completely illusory" because of the prospect of his immediate arrest.
In their legal submission to the Working Group they said Assange had been deprived of "fundamental liberties", because Britain had denied him the benefit of Ecuador's grant of asylum in 2012.
"He has no access to fresh air or sunlight, his communications are restricted and often interfered with, he does not have access to adequate medical facilities, he is subjected to a continuous and pervasive form of round-the-clock surveillance, and he resides in a constant state of legal and procedural insecurity," the submission said.
"If he continues to remain in the Ecuadorian Embassy, he risks irreparably damaging his health. If, however, he leaves at any juncture, he must – against his consent – renounce his fundamental right to asylum, and expose himself to the prospect of unfair proceedings and physical and mental mistreatment in the United States of America.
"The only way for Mr Assange to enjoy his right to asylum is to be in detention. This is not a legally acceptable choice."
A spokeswoman from Britain's Foreign Office said they would "not pre-empt any opinions from the UN Working Group on Arbitrary Detention".
"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," she 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."
The five members of the UN group who made the decision include one Australian – legal expert Leigh Toomey.
The group has made previous rulings on illegal detention which were followed by their release, such as Aung San Suu Kyi in Myanmar. However, in 2014 it called for the release of former Egyptian president Mohamed Morsi, who is still in jail.
Australian Foreign Minister Julie Bishop said she had not yet seen the opinion from the UN group.
"I will certainly read the report, I will certainly get a briefing on it and I will certainly seek advice," she said. "The standing of the report would be a matter for the British government because there is an extradition process under way... (the opinion is) not binding so the British government may well say nothing has changed."
Morning & Afternoon Newsletter