New York: Lawyers for the WikiLeaks founder Julian Assange asked a British judge on Friday to drop a 2012 arrest warrant, a request that if granted could allow Assange to leave the Ecuadorean Embassy in London, where he has been living for five-and-a-half years, and fly to Ecuador, which has granted him citizenship.

Assange, a 46-year-old native of Australia, was ordered extradited to Sweden in February 2011 to face a charge of rape, which he denied. After his challenges to the extradition order were refused, he skipped bail and fled to the embassy in June 2012. He was granted asylum two months later and has remained at the embassy, in the wealthy Knightsbridge district of West London, ever since.

Assange feared that Sweden would turn him over to the United States to face prosecution over WikiLeaks’ publication of troves of classified government documents on the wars in Afghanistan and Iraq, classified diplomatic cables and electronic hacking by the CIA, among other subjects.

Sweden dropped the rape inquiry in May, and withdrew the European arrest warrant it had requested. But the British authorities insist that Assange could still be arrested, for bail violations, if he leaves the embassy. He has been trying to quash the British warrant, fearing that British authorities could detain him and turn him over to the Americans if he leaves the embassy.

No known charges have been filed against Assange in the United States, but the Justice Department has contemplated prosecuting him, and Attorney-General Jeff Sessions has said that arresting Assange was a priority.

Britain has turned down Ecuador’s request to grant Assange diplomatic immunity, which would allow him to leave the embassy without fear of arrest.

On Friday, Assange’s lawyer, Mark Summers, told the Westminster Magistrates’ Court that Sweden’s withdrawal of a European arrest warrant meant the British arrest warrant for violating bail no longer applied.

“It’s lost its purpose and its function,” he said.

He argued that the purpose of the British warrant was to let the extradition case — now a moot point — continue, not to charge Assange with violating bail.

And even if the court disagrees, Summers said, it should find that it was “not in the public interest” to charge Assange with bail violations.

Assange had “reasonable grounds” for having sought refuge in the embassy, his lawyer argued, citing the case of Chelsea Manning, the former US Army soldier who was imprisoned for leaking documents to WikiLeaks, until her sentence was commuted last year; calls by Mike Huckabee for Assange to be executed; and findings by UN experts that his stay in the embassy amounted to inhuman and degrading treatment.

“He has spent 5 1/2 years in conditions which, on any view, are akin to imprisonment, without access to adequate medical care or sunlight, in circumstances where his physical and psychological health have deteriorated and are in serious peril,” Summers wrote in a note to the court.

Aaron Watkins, representing the Crown Prosecution Service, asked the court to deny Assange’s request. He said that the warrant should stand and that Assange could be arrested and prosecuted for the crime of skipping bail.

He said it could not be in the public interest for Assange — having evaded arrest for so long that Swedish prosecutors dropped their case — “not to be arrested or punished for his failure to surrender and for his contempt for the court process.”

Assange’s hypothetical fear of extradition to the United States was “not a reasonable explanation” for his contempt of court, Watkins added.

The court’s chief magistrate, Emma Arbuthnot, who noted the doctors’ statements that Assange suffered from depression, tooth pain and a stiff shoulder, adjourned the hearing until February 6.