The UN Working Group on Arbitrary Detention has played a valuable role in highlighting unjust and improper imprisonment, often of political prisoners. Only last October, it condemned the Maldives courts for imprisoning the first democratically elected president, Mohamed Nasheed, on terrorist charges without a fair trial. In 2007, it condemned the house arrest of Aung San Suu Kyi. But its latest opinion, which is expected to be formally published tomorrow, that the WikiLeaks founder Julian Assange is being detained arbitrarily, is simply wrong. He is not being detained arbitrarily. Three-and-a-half years ago, he sought refuge in the Ecuadorian embassy in order to avoid extradition to Sweden to face allegations of sex offences. He had fought extradition through every court, and at each his case was rejected. “Arbitrary” detention means that due legal process has not been observed. It has. This is a publicity stunt.

Three of the four alleged offences, dating back to 2010, now took place too long ago for Mr Assange to face prosecution. But there is an outstanding accusation of rape that the Swedish authorities can pursue until 2020. It is true that he has never been charged, as his lawyers have argued. But that is because Swedish legal procedure requires an interview to take place before any decision to prosecute: since Mr Assange left Sweden in 2010 before he could be questioned and has resolutely refused to return, no such interview has taken place. There are continuing negotiations between the Swedish, British and Ecuadorian authorities to arrange for an interview to take place in the embassy to where Mr Assange fled in August 2012. It may soon actually happen.

Mr Assange, who invited the UN panel to examine his case in 2014, knew the outcome in advance. That may account for his offer to give himself up to the British authorities if its opinion went against him. He will hope that its findings allow him to claim some kind of moral victory, and strengthen his call that the Swedish authorities drop their investigations. But he would still face arrest in the UK: he was granted bail while he fought extradition to Sweden and he broke his bail conditions, at great expense to those friends and supporters who had backed him financially, by fleeing to the Ecuadorian embassy. No doubt the conditions of his self-imprisonment are unpleasant; they are certainly severely limiting. But it is possible to sympathise with his circumstances, and to applaud his role in the WikiLeaks revelations that exposed embarassing and sometimes illegal US activity that were published in the Guardian (while deploring his later decision to dump many more, unmediated, on the web) without accepting his right to evade prosecutors’ questions about the allegation that he committed a serious criminal offence.

He has always argued that it is not the sex offence inquiries that he is avoiding, but extradition from Sweden to the US. Chelsea Manning, the soldier who originally downloaded the material and leaked it to Mr Assange, is serving a long sentence in military detention. There are indications that WikiLeaks is in the US justice department’s sights: it’s been confirmed that a grand jury is investigating; no indictment has been made public, but that does not mean there is none. Equally, the justice department could decide to make a distinction between government employees and military personnel who had a duty to protect classified information, and those who, like Mr Assange, published it. But WikiLeaks was founded on exposing those who ignored the rule of law. Surely its editor-in-chief should recognise his duty to see it upheld.