Sajid Javid “gave up” on attempts to ensure the US did not execute two British Isis militants because he feared sparking outrage in Donald Trump's administration, a court has heard.

El Shafee Elsheikh and Alexanda Kotey, who were allegedly members of a cell dubbed "The Beatles" and who killed a series of hostages in Syria, have been the subject of a legal dispute between the US and UK since being captured in January.

Earlier this year a leaked letter showed that Mr Javid had agreed to hand evidence on the pair to American authorities for a federal prosecution, but without assurances that the death penalty would not be used.

Elsheikh's mother, Maha Elgizouli, is attempting to launch a judicial review over the decision and claims it is unlawful.

Her lawyers told the Lord Chief Justice, Lord Burnett, and Mr Justice Garnham that the “unprecedented and unjustified” move was taken against advice from government departments and violated precedent.

Edward Fitzgerald QC said it was influenced by the “anticipated outrage” of members of the Trump administration if the UK demanded assurances that the pair would not face the death penalty.

"[Mr Javid] wrongly exposed the suspects to the very real risk of an inhuman punishment,” he told the Administrative Court in London.

"This country should not facilitate the imposition in another country of a punishment which we ourselves recognise as inhuman and unlawful.

Sajid Javid dropped the UK's insistence on assurances against the death penalty to hand over evidence on Kotey and Elsheikh (BBC/PA)

"He took those steps in large part because of the anticipated outrage of certain political appointees in the Trump administration if the UK insisted on death penalty assurances.

“We submit that the anticipated outrage of those US officials was not a proper consideration as a matter of law.”

Lawyers for Mr Javid argued that there is no common law prohibition on providing legal assistance to another country where it may result in proceedings leading to the death penalty.

“This group [the Isis Beatles] is associated with some of the gravest offences perpetrated against civilians in Syria during the conflict,” James Eadie QC told the court.

”These beheadings are notorious globally, all but one having been filmed and posted on the internet.”

He said Mr Javid's decision was rational, did not create inconsistency with the UK's general death penalty policy and “did not misdirect himself in law or fact”. Mr Eadie also said the government had not violated the Data Protection Act.

The court heard that the US first made a request for “mutual legal assistance” (MLA) on Kotey and Elsheikh in June 2015, when the then home secretary, Theresa May, said material would not be handed over without assurances against the death penalty.

In response the US Department of Justice offered partial assurances that it would not make direct use of the evidence in its case but the British government did not change its position.

Mr Fitzgerald said it remained consistent even after Donald Trump was sworn in as president, and the Home Office was still demanding full assurances against the death penalty in August 2017.

After Elsheikh and Kotey were detained in Syria in January, the Crown Prosecution Service reviewed the 600 witness statements gathered by the Metropolitan Police but concluded that there was “insufficient evidence” to prosecute them in Britain.

Mr Fitzgerald said that although the current proceedings were not challenging that decision “it does seem very strange that if this country has evidence that is sufficient to put these two suspects on trial in the US, that they can't be tried for anything in this country”.

Kotey and Elshiekh are accused of being part of the Isis cell that executed James Foley and other British and American hostages (AP)

He said that in March Amber Rudd met the US attorney general, Jeff Sessions, who requested the UK put the suspects on trial itself and “expressed a favourable view of Guantanamo” if they had to be handled by the US.

Then in April, the security minister Ben Wallace held talks with the US Department of Justice where the court heard he was “informed of the opposition of senior members of the administration” to a federal trial and “strong voices arguing for Guantanamo”.

Later that month Ms Rudd resigned as home secretary and was replaced by Mr Javid, who discussed the case with Mr Sessions by phone.

The US attorney general said he “did not want his hands tied” by UK demands and insisted that the death penalty “should not be an issue”, Mr Fitzgerald said.

Then in May a briefing by the British ambassador in Washington warned that continued demands could cause “something close to outrage” among Mr Trump's political appointees.

Mr Fitzgerald said the advice expressed fears that Mr Sessions, Secretary of Defense James Mattis, Secretary of State Mike Pompeo and others would “wind the president up to complain to the PM and potentially, to hold a grudge” that could damage bilateral relations.

The UK Central Authority continued recommending that the UK demanded full assurances against the death penalty, which the US has complied with in other cases, but days later there was an “about-turn”.

Mr Fitzgerald said that in a meeting with Mr Sessions on 30 May, Mr Javid “assessed that if he asked for assurances, whether full or partial, it was likely to provoke outrage”.

“We submit that that about-turn was both unreasonable and unlawful,” he added, accusing the government of “washing its hands”.

“Effectively he gave up … Mr Javid didn't even try, he made no attempt to ask for assurances at all. We submit that that was an unworthy capitulation.”

The home secretary informed Boris Johnson of the change in June, claiming that “significant attempts” had been made and that the dropping of assurances would mitigate the risk of Kotey and Elsheikh being detained in Guantanamo.

In a letter, Mr Javid noted the risk of “key US political appointees” reacting with “outrage”. In his reply, Mr Johnson said there was also American dissatisfaction with the UK's “perceived unwillingness to pursue a prosecution, while at the same time seeking to dictate terms to the US”.

Syrian Democratic Forces take Raqqa from Isis – in pictures Show all 8 1 /8 Syrian Democratic Forces take Raqqa from Isis – in pictures Syrian Democratic Forces take Raqqa from Isis – in pictures Syrian Democratic Forces fighters celebrate victory in Raqqa atop of military vehicles REUTERS Syrian Democratic Forces take Raqqa from Isis – in pictures Fighters of Syrian Democratic Forces march past destroyed buildings as they celebrate victory REUTERS Syrian Democratic Forces take Raqqa from Isis – in pictures Fighters of Syrian Democratic Forces gesture the "V" sign in Raqqa REUTERS Syrian Democratic Forces take Raqqa from Isis – in pictures Fighters of Syrian Democratic Forces evacuate a civilian from the stadium REUTERS Syrian Democratic Forces take Raqqa from Isis – in pictures A civilian prays after she was rescued by fighters of Syrian Democratic Forces from the stadium REUTERS Syrian Democratic Forces take Raqqa from Isis – in pictures Syrian Democratic Forces fighters ride atop of military vehicles as they celebrate victory in Raqqa REUTERS Syrian Democratic Forces take Raqqa from Isis – in pictures Syrian Democratic Forces fighters celebrate victory in Raqqa REUTERS Syrian Democratic Forces take Raqqa from Isis – in pictures A fighter of Syrian Democratic Forces celebrates in Raqqa Reuters

The then foreign secretary backed the transfer of evidence but warned that it could reduce the UK's global “moral authority” on the death penalty, while providing fodder for radicalisers.

On 22 June Mr Javid communicated the decision to Mr Sessions to provide material without assurances.

“The decision was an unprecedented and unjust,” Mr Fitzgerald told the court. “It wrongly exposed the suspect to the serious risk of execution and moreover such execution is likely to follow.”

He argued that the home secretary also violated the Data Protection Act and failed to consider the long periods spent on death row in the US, and evidence of “extreme pain” caused by lethal injection.

The home office announced a temporary pause of the MLA after Elsheikh's mother launched legal action but evidence will continue to be transferred if it fails.

Mr Fitzgerald said the case was “not so much about the rights of Elsheikh” but about the government being held to its own previous policy and the rule of law.

“The claimant [his mother] has not come before this court to excuse the appalling acts with which her son has been linked, if those acts are proved against him, and has not come to oppose that if he is convicted he is appropriately punished,” he added.

"Her concern is the death penalty and she asks that the government should be held to its general policy and invariable practice of seeking death penalty assurances before providing evidence pursuant to the MLA treaty."

Families of the hostages murdered by the Isis Beatles have said they want Kotey and Elsheikh put on trial but not executed, as have their surviving victims.

Mr Javid has faced criticism from all parties over his decision, which was branded “extraordinary” and a “dramatic change of policy” by the former reviewer of anti-terror legislation, Lord Carlile.

Kotey and Elsheikh, who were raised in the UK, remain detained by Kurdish forces in Syria and are among alleged Isis fighters to be stripped of their British citizenship.

Terror experts have cautioned that executing them would hand Isis a fresh propaganda victory as it seeks to regroup in new “wilayat” (provinces) following territorial losses across Syria and Iraq.

Originally from London, the pair were declared “Specially Designated Global Terrorists” by the US State Department ahead of their capture in January, with official documents naming them as members of “The Beatles” and saying the cell had beheaded more than 27 hostages and tortured many more.

Surviving captives have told of their brutality, which included waterboarding, electric shocks, mock executions and crucifixions.

Executioner Mohammed Emwazi, who became known as “Jihadi John”, was killed in a drone strike, while the remaining "Beatle", Aine Davis, is imprisoned in Turkey.