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 U.N. 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.
"I don't know if he has recognized that he acted against rules and norms of a political system, but at the time these cables demonstrated how the world system functions in its authoritarian nature," Lopez Obrador said in response to a question about Assange at a regular government news briefing.
"Hopefully consideration will be given to this, and he's released and won't continue to be tortured."
Assange's presence in London, holed up in Ecuador's embassy and then in jail, has been a diplomatic irritation for Britain, affecting domestic politics and relations with several countries.
Corbyn, who was a guest of honor at Lopez Obrador's inauguration in December 2018, said Assange should not be extradited to the United States "for exposing evidence of atrocities in Iraq and Afghanistan."British Prime Minister Boris Johnson, whose Conservative Party trounced Labour in last month's elections, has vowed to strike new trade deals with countries outside Europe after Britain's departure from the European Union.