John Pilger and Peter Tatchell explain why they've pledged money in surety for the WikiLeaks founder's bail outside the appeal hearing at Westminster magistrates court in central London Press Association

The WikiLeaks founder, Julian Assange, is to remain in jail after the Swedish authorities decided to challenge a decision by a British court to grant him bail on allegations of rape in Stockholm.

A judge in London granted Assange £240,000 bail with strict conditions, including a curfew and the surrendering of his passport.

But when counsel for the prosecution indicated it would appeal, the judge told Assange he would remain in jail until a hearing at a higher court within 48 hours.

Assange's lawyer, Geoffrey Robertson, had asked the City of Westminster magistrates court in London for bail on five conditions: £200,000 in security, surety of £40,000 from two people, a curfew, daily reporting to police, and surrender of his passport. The judge agreed, to much rejoicing among Assange's supporters.

But elation turned to anger as lawyers representing Sweden challenged the decision.

Speaking outside the court, Mark Stephens, one of Assange's lawyers, said: "The prosecution is doing no more than taking instructions from Sweden.

"They are continuing to persecute Mr Assange ... An innocent man is in custody."

The decision followed two hours of confusion as Stephens first said he understood that the prosecution would decline to challenge the court's decision.

Sweden's decision means that the next legal arguments will be heard at the court of appeal. No time has yet been fixed.

Assange entered Westminster court one at 2.12pm looking paler than at a previous hearing last week, and wearing a dark jacket and open-necked white shirt. With so much press interest, people were given permission to stand; in a break with tradition, journalists were allowed to tweet the proceedings.

Amid chaotic scenes, Robertson, who cut short a holiday in Australia to be in court, had to bang on the door to get in.

Some of Assange's celebrity supporters attended the hearing, including socialite Jemima Khan, Bianca Jagger and Fatima Bhutto, niece of the assassinated Benazir Bhutto of Pakistan. Outside, one protester held up a placard that read "Sex crimes, my arse!" But media outnumbered the protesters, who were about 30 strong.

Arguing that Assange should be granted bail, Robertson challenged the legal basis on which the WikiLeaks founder had been arrested. He said: "We doubt whether this actual category of rape would be rape under English law," he told the court.

Appearing for the Swedish authorities, Gemma Lindfield argued that Assange should be declined bail as the charges were serious and there was a real possibility he would leave the country.

"This is not a case about WikiLeaks, rather a case about alleged serious offences against two women," she said.

She said the allegations were serious and Assange had only weak ties to Britain and "the means and ability to abscond".

The judge rejected her arguments and agreed that Assange would stay at Ellingham Hall in Suffolk, an estate owned by Vaughan Smith, founder of the Frontline club in London, who is one of the people offering security. Assange will have to report daily to a nearby police station at Bungay.

The initial decision was greeted by cheers outside the courtroom, and Assange's supporters welcomed the move.

"I'm very pleased that he is out," said the writer and political activist Tariq Ali. "I think the extradition charges should now be dealt with in the same way. His barrister made the same point, that this is not rape under English law and there is absolutely no reason for extradition. We are delighted he is out and he should never have been locked up in the first place."

Even if the Swedish challenge fails, it could be a week before Assange is released. Mark Stephens, another of Assange's lawyers, said it would take some time to raise the bail money.

Accusing the Swedish authorities of mounting a "persecution not a prosecution", Stephens said Assange would have to stay behind bars until the £200,000 is raised in cash and delivered to the court, as it did not accept cheques.

Speaking to reporters after the court hearings, Stephens said: "There is enormous relief tinged with enormous sadness. Assange will spend another night in solitary confinement. It's a pretty unpleasant situation he's going through."

Before the hearing, Assange remained defiant, telling his mother, Christine, from his cell he was committed to publishing more secret US cables. "My convictions are unfaltering. I remain true to the ideals I have expressed. This circumstance shall not shake them," Assange said, according to a written statement of his comments supplied to Australia's Network Seven by his mother.

"We now know that Visa, Mastercard, PayPal and others are instruments of US foreign policy. I am calling for the world to protect my work and my people from these illegal and immoral attacks," he said in the statement.

The 39-year-old Australian turned himself in to Scotland Yard detectives last week after being accused of sexually assaulting two women in Sweden. Sweden has yet to formally charge Assange with any offence.Assange has vowed to fight attempts to extradite him.

He was denied bail by district judge Howard Riddle at City of Westminster magistrates court last Tuesday, on the grounds that there was a risk he would fail to surrender. The decision to remand him in custody came despite the film director Ken Loach, the journalist John Pilger, Khan and other suporters offering sureties for him totalling £180,000.

His legal team has claimed Swedish prosecutors were put under political pressure to restart their inquiry to help silence and discredit Assange, whose website has provoked US anger by publishing some of a cache of 250,000 classified US diplomatic papers.

Stephens, visited him in Wandsworth prison yesterday afternoon, and said his client was being held under harsher conditions than last week. He claimed Assange was being confined to his cell for all but half an hour a day, and denied association with others prisoners, access to the library or TV.

Stephens also claimed a number of letters to Assange from media organisations had not reached the WikiLeaks founder. He said Assange was under 24-hour video surveillance and had complained that a tooth that broke off while he was eating had later been stolen from his cell.