Julian Assange will not face the death penalty if he is extradited to the US, the British government has said.

In newly revealed letters sent to Ecuador’s president Lenin Moreno, both current foreign secretary Jeremy Hunt and his predecessor Boris Johnson said an extradition would not be ordered “unless the home secretary has first received an adequate assurance that the death penalty will not be imposed”.

“You have expressed concern that, should Julian Assange be extradited from the UK, there would be a risk that he could be subject to the death penalty,” said identically-worded letters sent to and obtained by The Guardian. “Under UK law, a person’s extradition cannot be ordered if the person concerned will be subject to the death penalty.”

Dated on 7 March and 10 August 2018, they said that if the home secretary accepts an assurance against capital punishment as adequate, the “person concerned may also seek leave to appeal to the High Court, which will examine the assurance given”.

The government has not demanded assurances against the death penalty in other cases, including two alleged Isis “Beatles” militants from the UK last year.

Key moments for Julian Assange Show all 9 1 /9 Key moments for Julian Assange Key moments for Julian Assange The situation today Assange was arrested after Metropolitan Police officers were invited into the Ecuadorian embassy on April 11 2019. How did it come to this? Ruptly TV Key moments for Julian Assange The break Assange shows the front page of the Guardian on July 26 2010, the day that they broke the story of the thousands of military files leaked by WikiLeaks AFP/Getty Key moments for Julian Assange Wanted A warrant for Assange's arrest was issued in August 2010 for counts of rape and molestation in Sweden AFP/Getty Key moments for Julian Assange Ruling The UK's Supreme Court ruled in 2012 that Assange should be extradited to Sweden to face trial Getty Key moments for Julian Assange Sanctuary Following the ruling, Assange was given asylum by the Ecuadorian governement over fears that his human rights would be violated if he were extradited, he has since remained in the embassy in London Getty Key moments for Julian Assange A friend in Pam Friend Pamela Anderson delivers lunch to Assange at the embassy in October 2016. She has since spoken against his arrest Getty Key moments for Julian Assange Arbitrarily detained A UN panel found in 2016 that Assange had been arbitrarily detained and that he had not been able to claim his full right to asylum. It urged Sweden to withdraw the charges against him Getty Key moments for Julian Assange The cat ultimatum Last year, the Ecuadorian embassy threatened to revoke Assange's internet access unless he stopped making political statements online and started taking better care of James, his pet cat. Assange accused Ecuador of violating his rights Reuters Key moments for Julian Assange Arrest Assange was arrested on April 11 2019. Ecuador revoked his asylum status and invited the Metropolitan Police in to the embassy to arrest him. Reuters

The home secretary handed the US information on Alexander Kotey and Shafee El-Sheikh for a federal prosecution last June, after they were caught by Kurdish forces in Syria.

Lawyers representing El-Sheikh’s mother accused home secretary Sajid Javid of giving up on death penalty assurances because of “anticipated outrage” from Donald Trump’s administration.

But the High Court found the decision was legal, ruling that there was “no general, common law duty on HM government to take positive steps to protect an individual's life from the actions of a third party”.

The letters on Assange were sent before the WikiLeaks founder was stripped of his political asylum and Ecuadorian nationality.

The country’s ambassador formally invited London's Metropolitan Police to remove Assange from its London embassy last week.

Mr Moreno said “the patience of Ecuador has reached its limit on the behaviour of Mr Assange”, but his lawyers denied “outrageous” allegations regarding his personal hygiene including that he had smeared faeces on the embassy walls.

“The discourteous and aggressive behaviour of Julian Assange, the hostile and threatening declaration of its allied organisation [WikiLeaks] against Ecuador, and especially the transgression of international treaties, have led the situation to a point where the asylum of Mr Assange is unsustainable and no longer viable,” Mr Moreno added.

Julian Assange's lawyer denies the WikiLeaks founder spread faeces on Eduadorian embassy walls

“In all cases, the relevant judicial authorities have validated Ecuador's position. In line with our strong commitment to human rights and international law, I requested Great Britain to guarantee that Mr Assange would not be extradited to a country where he could face torture or the death penalty. The British government has confirmed it in writing, in accordance with its own rules.”

Assange had been living at the Ecuadorian embassy for almost seven years, after losing a court battle against extradition to Sweden over rape allegations.

That investigation was dropped in 2017 but the British police warrant for skipping bail remained, and was the reason initially cited for arresting Assange.

After arriving at a London police station, he was re-arrested under a US extradition warrant.

The US Department of Justice said he had been with one count of conspiracy to commit computer intrusion with Chelsea Manning, over the military leaks that exposed war crimes in 2010.

Assange faces a maximum sentence of five years in prison if convicted, though he may yet be charged with other offences.

His lawyer, Jennifer Robinson, said the charge “sets a dangerous precedent for all media organisations and journalists in Europe and around the world”.