STOCKHOLM, Sweden -- A Swedish appeals court upheld the detention order on Julian Assange on Thursday, dismissing a challenge by the WikiLeaks founder who is wanted by prosecutors in an investigation of alleged sex crimes.

Confirming a ruling by a lower court, the Svea appeals court said there is no reason to lift the detention order just because it can't be enforced at the moment. Assange has avoided being extradited to Sweden by taking shelter in the Ecuadorean Embassy in London since 2012.

The court also criticized the prosecutors, who have declined Assange's offer to be questioned in London, for not considering "alternative avenues" to move the investigation forward.

But it added that "the reasons for detention still outweigh the reasons to the contrary since Julian Assange is suspected of crimes of a relatively serious nature and there is a great risk that he will evade legal proceedings or punishment if the detention order is set aside."

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

His lawyers argued that the detention order that underlies Sweden's request for his extradition should be lifted, on the grounds that it cannot be enforced while he is at the embassy and because it is restricting Assange's civil rights.

They also wanted prosecutors to release text messages that the women sent to Assange and that he believes show there is no basis for his arrest. The appeals court also rejected that request.

Assange's lawyer, Per E. Samuelson, said the defence team would appeal the ruling to the Supreme Court.