Julian Assange is being "arbitrarily detained" in the Ecuadorian embassy in London where he has hid from extradition over allegations of sexual crimes, the UN is about report.
The Wikileaks founder pledged to hand himself over to police for arrest on Friday if the UN ruled against him when it formally reports.
But the Swedish foreign minister has now confirmed the UN will side with Assange, prompting speculation Assange had already had sight of its findings before he made his pledge, knowing he would not have to act on it.
He is wanted for questioning in Sweden over alleged sexual offences against two women, which he has always denied, and is fighting against extradition.
He has not left the Ecuadorian Embassy in Knightsbridge, west London, since June 2012 and was subsequently granted political asylum by the South American nation.
Julian Assange has said he will hand himself in on Friday if the UN approves his extradition
A spokesperson for Sweden's foreign ministry said the UN's working group, whose decision has no legal effect, had "made the judgement that Assange has been arbitrarily detained in contravention of international commitments."
Assange filed a complaint against Sweden and the UK in September 2014 which is being considered by a group of legal experts for the UN, who are expected to deliver their findings on Friday.
The UN Working Group on Arbitrary Detention has made previous rulings on whether imprisonment or detention is lawful, although the group does not have any direct bearing on British and Swedish authorities.
If the working group finds Assange's detention to be unlawful the UN is expected to call on the UK and Sweden to let him go free.
Assange believes he will be transported to the United States to be quizzed over the activities of WikiLeaks if he goes to Sweden.
In a statement published by WikiLeaks early on Thursday morning, Assange said he expected to be able to walk free if the British and Swedish authorities fail to receive UN approval for extradition.
Assange said: "Should the UN 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.
"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."
The statement was signed: "Julian Assange, Embassy of Ecuador, London."
But the Metropolitan Police, which posted a permanent guard outside the embassy for years after Assange sought shelter there, said the ruling would not affect its efforts to arrest him and hand him over to Swedish authorities.
Assange's friend, journalist Vaughan Smith - who gave him refuge at his home after the Swedish allegations were first made in 2010 - told BBC Radio 4's Today programme that Assange wanted to see "a resolution" to the case.
Smith said Assange viewed himself as "a political prisoner", saying he had gone into the embassy to maintain his liberty.
He told the BBC that he viewed Assange as a "sort of a dissident".
According to the website justice4assange.com, the 44-year-old Australian has so far spent 1,885 days inside the embassy "under house arrest".
Before entering the embassy, Assange had been held at home and in prison since December 2010. He spent months fighting extradition to Sweden through the courts and fled to the embassy after he exhausted his legal options.
Assange no longer faces investigation for two counts of sexual molestation and one of unlawful coercion, as the five-year deadlines for prosecuting these crimes in Sweden have lapsed.
But Swedish prosecutors are still investigate one count of suspected rape, which has a 10-year, not five-year, limit.