LONDON - A British judge agreed Tuesday to release Julian Assange on bail, potentially setting the controversial founder of the WikiLeaks Web site free in coming days to fight an extradition warrant to Sweden from outside a prison cell.

Assange remained in custody, however, as British prosecutors representing Sweden challenged the decision, with a hearing on their appeal to be heard by Britain's High Court no later than Thursday. Assange's wealthy backers, who include Bianca Jagger and U.S. filmmaker Michael Moore, were also scrambling to come up with the funds - equivalent to about $380,000 - to cover his bail and provide other required financial assurances.

Judge Howard Riddle's decision reverses a ruling last week that led to Assange's arrest and detention in connection with Sweden's request for his extraditionto face sex-crime allegations. Though Riddle described Assange as a flight risk last week, he said Tuesday that the 39-year-old Australian could be freed if he surrendered his passport, wore an electronic tag and kept a curfew while staying at the home of Vaughan Smith, a British restaurateur and former war correspondent who has agreed to house Assange at his estate northeast of London.

Saying he was making a stand for "tolerance" and press freedom, Smith said: "He has told me he is innocent, and I believe him."

The reversal marks a key victory for Assange, who could soon be free and back in front of his laptop during what is now set to be a complicated and protracted legal process. The full extradition hearing is not scheduled to be held until Feb. 7 and 8.

Assange would, however, be kept under strict watch and required to check in regularly with the police. He would also have to abide by an indoor curfew between 10 p.m. and 2 a.m. and between 10 a.m. and 2 p.m.

Assange has strongly denied the Swedish allegations, suggesting they are part of an international plot to dam the flood of secret U.S. documents that WikiLeaks is posting on the Internet, angering and embarrassing Washington and governments around the world. His mother, Christine Assange, flew in from Australia to support her son in court Tuesday, sitting with other backers, as several dozen more rallied on his behalf outside.

In an unusual move, the court required $310,000 of the $380,000 in bail to be put up in cash. Assange's supporters said they had raised a significant portion from prominent donors and were working to secure the rest.

"There is no case against Julian Assange," filmmaker and journalist John Pilger said on the courthouse steps.

On Tuesday, Assange, his blond hair graying, looked haggard in his dark suit and open-collared white shirt as he walked into the courtroom carrying two folders under his arm. One of his attorneys, Mark Stephens, said his client was enduring "Dickensian conditions" at London's Wandsworth Prison, kept in solitary confinement, denied a computer and permitted only heavily censored reading material.

Assange could now more closely aid his lawyers - including noted human rights attorney Geoffrey Robertson - in mounting a defense to block extradition, while also masterminding more WikiLeaks releases.

In a statement through his mother before the bail hearing, Assange said: "I remain true to the ideals I have expressed. This circumstance shall not shake them. If anything, this process has increased my determination that they are true and correct."

It remains unclear whether U.S. officials, who have said they are investigating Assange in connection with the documents release, will file charges. If they do while Assange is in Britain, the government here would have to weigh the U.S. and Swedish requests and decide which, if either, to honor.