Mexico has said that it was ready to offer political asylum to WikiLeaks founder Julian Assange, after a British judge blocked his extradition to the United States to face espionage charges.

"I'm going to ask the foreign minister to carry out the relevant procedures to request that the UK government releases Mr Assange and that Mexico offers him political asylum," President Andres Manuel Lopez Obrador told reporters.

The leftist leader welcomed the British court's rejection of the US request to extradite the 49-year-old Australian publisher due to the risk of suicide, calling it a "triumph of justice".

"Assange is a journalist and deserves a chance," he said.

Lopez Obrador said Mexico would ensure "that whoever receives asylum does not intervene or interfere in the political affairs of any country".

Mexico has welcomed many political asylum-seekers over the years, from Nicaraguan anti-imperialist hero Cesar Augusto Sandino to Russian revolutionary Leon Trotsky and, more recently, former Bolivian president Evo Morales.

"Mexico has a long history of offering asylum," Adolfo Laborde, an academic and foreign relations expert, told AFP.

Whether Assange joins the list would depend on political pressures and the stances of the various actors and countries with an interest in his fate, Mr Laborde said.

Assange is wanted on 18 charges in the United States relating to the 2010 release by WikiLeaks of 500,000 secret files detailing aspects of military campaigns in Afghanistan and Iraq.

If convicted in the US, he faces up to 175 years in jail.

Arturo Sarukhan, a former Mexican ambassador to the United States, said the asylum offer risked causing tensions with the incoming administration of US President-elect Joe Biden.

He said Lopez Obrador appeared to be ignoring or overlooking WikiLeaks' publication of 20,000 hacked emails from the US election campaign team of Democrat Hillary Clinton in 2016.

The Mexican president "is turning the issue into another potential area of friction with the next US administration," Mr Sarukhan said.

President Lopez Obrador's relations with Mr Biden had already got off to a rocky start as he was one of the last high-profile leaders to congratulate him on his victory, saying he wanted to wait until legal disputes were resolved.

Activists held a protest in front of the British embassy in Mexico City after the court decision, demanding Assange be released.

Read more:
Latest chapter in divisive Assange saga

The US Justice Department said that it was "extremely disappointed" at the judge's decision not to extradite Mr Assange.

"While we are extremely disappointed in the court's ultimate decision, we are gratified that the United States prevailed on every point of law raised," the department said.

"We will continue to seek Mr Assange's extradition to the United States."

Defence witnesses called during the hearing said his history of depression meant he would be a suicide risk if sent to the US and locked up in a maximum security prison.

He has also complained of hearing imaginary voices and music during his detention.

Before the ruling, both Germany and a United Nations rights expert expressed concern over the human rights and humanitarian problems presented by the extradition.

Mr Assange has a respiratory condition that makes him more vulnerable to Covid-19, which has infected several inmates at the high-security prison where he has been held in London.

Supporters of Mr Assange were overjoyed at the decision not to extradite him to the US but expressed dismay that the ruling was made on health grounds.

His mother Christine urged the US not to appeal against the ruling, saying her son had suffered enough.

Mr Assange's mother tweeted: "UK Judge Vanessa Baraitser ruled against extraditing my son Julian to the US on medical grounds.

"US prosecutors state they will appeal. I implore Pres Trump & Pres elect Biden to order them to stand down.

"The decade long process was the punishment. He has suffered enough."

The US claims Mr Assange helped intelligence analyst Chelsea Manning to steal the 2010 documents before exposing confidential sources around the world.

After Sweden first issued an arrest warrant for Mr Assange in 2010 over allegations of sexual assault, he sought asylum in Ecuador's embassy in London, where he remained from 2012 until 2019.

In April 2019, Ecuador, by then ruled by right-wing President Lenin Moreno, revoked his citizenship. British police dragged Mr Assange out of the embassy.

He was arrested for breaching his bail terms, but remained in custody pending the ruling on the extradition request.

The earlier Swedish assault investigation against him was later dropped due to lack of evidence.