Mexico's President Andres Manuel Lopez Obrador on Friday called for WikiLeaks founder Julian Assange to be released from prison in London, urging an end to what he described as his "torture" in detention.

Assange, 48, is in a British jail for skipping bail when he sought asylum in Ecuador's embassy in London, where he spent nearly seven years to avoid extradition to Sweden over allegations of rape that were dropped in November.

Assange is also battling U.S. attempts to extradite him over WikiLeaks' publication of vast caches of leaked military documents and diplomatic cables. He faces a lengthy prison term if extradited to the United States.

A UN human rights investigator last year said Assange has suffered psychological torture from a defamation campaign and should not be extradited to the United States where he would face a "politicized show trial."

Lopez Obrador, a leftist who has close ties with Britain's opposition Labour Party leader Jeremy Corbyn, expressed his solidarity with Assange and said he hoped the former hacker and activist is "forgiven and released" from prison.