LONDON - A British court on Tuesday ruled to keep in place an arrest warrant for WikiLeaks founder Julian Assange , thwarting a bid that could have paved the way for him to leave the Ecuadorian embassy in London where he has spent the last five and a half years.

“I’m not persuaded that the warrant should be withdrawn,” judge Emma Arbuthnot said in criminal court in London, reading out her decision. But Arbuthnot was still considering a further application from Assange’s lawyers that the arrest warrant be scrapped on public interest grounds.

Assange entered the embassy in June 2012 to dodge a European arrest warrant and extradition to Sweden over a 2010 probe in the Scandinavian country into rape and sexual assault allegations.

Sweden dropped its investigation last year, but British police are still seeking to arrest Assange for failing to surrender to a court after violating his bail terms during his unsuccessful battle against extradition.

Assange’s lawyer Mark Summers had argued in court last week that the warrant had “lost its purpose and its function”. He said Assange had been living in conditions “akin to imprisonment” and his “psychological health” has deteriorated and was “in serious peril”.

The court heard that the 46-year-old was suffering from a bad tooth, a frozen shoulder and depression. But prosecutor Aaron Watkins called Assange’s court bid “absurd”.

“The proper approach is that when a discrete, standalone offence of failing to surrender occurs, it always remains open to this court to secure the arrest,” Watkins said.

Assange has refused to leave the embassy, claiming he fears being extradited to the United States over WikiLeaks’ publication of secret US military documents and diplomatic cables in 2010.

US Attorney General Jeff Sessions last year said his arrest was a “priority”.

Assange only very rarely emerges onto the balcony of the embassy building, citing concerns for his personal safety, but he frequently takes part in media conferences and campaigns via video link.

Ecuador in December granted citizenship to the Australian-born Assange , and asked Britain to recognise him as a diplomat, in an unsuccessful attempt to provide him with immunity and usher him out of its embassy without the threat of arrest. But London swiftly rejected the move.

“Ecuador knows that the way to resolve this issue is for Julian Assange to leave the embassy to face justice,” the British government said.

Assange has strained the patience of his hosts during his long stay. He was publicly reprimanded for interfering in the 2016 US election after publishing emails from the campaign team of Democrat Hillary Clinton.

More recently, he drew the ire of Ecuadoran President Lenin Moreno when he used Twitter to issue messages of support for Catalonia’s independence drive. Moreno was forced to respond to complaints from the Spanish government.

Moreno, in office since 2017, said last month Assange was an “inherited problem” that had created “more than a nuisance” for his government. “We hope to have a positive result in the short term,” Moreno said in an interview with television networks.