STOCKHOLM, Sweden — A Swedish court on Wednesday upheld its detention order on Julian Assange, reaffirming the legal basis for an international warrant for the WikiLeaks founder which has kept him hiding in the Ecuadorean Embassy in London for two years.

Assange’s defence team said it would appeal.

Defence lawyer Per Samuelson said they would study the judge’s decision in detail and then “write a juicy, toxic appeal” to a higher court.

“Our legal arguments are solid and powerful,” Samuelson told The Associated Press. “That they didn’t work could be because the judge didn’t give herself enough time to think.”

Last month, Assange’s lawyers filed a court petition to repeal the detention order — imposed by the Stockholm district court in November 2010 — on the grounds that it cannot be enforced while he is at the embassy and because it is restricting Assange’s civil rights.

Assange has not been formally indicted in Sweden, but he is wanted for questioning by police over allegations of sexual misconduct and rape involving two women he met during a visit to the Scandinavian country in 2010. He denies the allegations.

Prosecutors have ruled out the possibility of allowing police to question him in London.

Even if Sweden had dropped its case against Assange, he would face immediate arrest by British police for violating his bail conditions when he fled officials and sought refuge at the embassy. Police have maintained a constant presence outside the embassy since then.

In a meeting last month with reporters at the embassy to mark his second year of hiding, Assange said he had no intention of going to Sweden because he has no guarantees he wouldn’t subsequently be sent to the U.S., where an investigation into WikiLeaks’ dissemination of hundreds of thousands of classified U.S. documents remains live.

In a video link during the meeting, he also talked to Ecuadorean Foreign Minister Ricardo Patino, who told journalists that negotiations with Britain over Assange’s fate were at an impasse and that there would be no attempt to force him back to Sweden.

“We will protect Julian Assange for as long as necessary,” he said.