The supreme court in Stockholm upheld rulings by lower courts ordering the detention for Mr Assange, saying there is no reason to rescind it as the investigation continues.
His lawyers were, however, encouraged by a 4-1 decision by the judges, which a senior legal figure said indicated the court could still change its mind.
Since 2010, prosecutors have sought to interrogate Mr Assange over allegations of rape, sexual molestation and illegal coercion made by two women after his visit to Sweden that year. Assange denies the allegations and has not been formally indicted.
Swedish prosecutors in March agreed to question Mr Assange in London where he has been living in the Ecuadorean Embassy for nearly three years to avoid being extradited.
Mr Assange’s lawyers say he fears extradition to Sweden would merely be a first step in efforts to take him to the United States, where WikiLeaks infuriated officials by publishing secret documents including 250,000 State Department cables.
But the former computer hacker has not been charged with any crime in the US and the Americans have not issued the UK with an extradition request.
It is not clear when the Swedish prosecutors will travel to London. They are still discussing practical details with Mr Assange’s defence lawyers, such as possible dates and who will be present for the interrogation, said Karin Rosander, a spokeswoman for the Swedish Prosecution Authority.
Stockholm’s supreme court said in its ruling: “The public interest in the investigation continues to weigh heavily. In view hereof, and the risk that Julian Assange may evade prosecution if the arrest warrant is lifted, continued detention is currently regarded as compatible with the principle of proportionality.”
Mr Assange’s lawyer, Per Samuelson, said yesterday: “We are of course disappointed and critical of the Supreme Court’s way of handling the case.”
Mr Samuelson also condemned what he called a weak decision by the court, which he said had issued its ruling before the Assange team had made its final submission.
But the split decision suggests that the supreme court’s position on proportionality is not set in stone, according to Anne Ramberg, head of Sweden’s Bar Association. “The reasoning of the court indicates that it may take a different view with the passing of further time,” she said