A former British soldier accused of passing secret information to Iran could have put special forces personnel “at threat” when he covertly gathered their names, a court has heard.

Daniel Khalife, 23, took a photo of a handwritten list of 15 soldiers, including some serving in the Special Air Service (SAS) and Special Boat Service (SBS), Woolwich Crown Court was told.

A senior army intelligence officer, named only as Soldier A, told the court the information gathered by Khalife could have proved “beneficial” to a “hostile adversary”.

He took details from an internal spreadsheet of promotions in June 2021, sent to a WhatsApp group and then logged on to an internal HR system for booking leave to try to find out the soldiers’ first names, the trial heard previously.

The internal spreadsheet had been leaked, the court was told, and had been reported by the media.

Jurors were shown a photograph from Khalife’s iPhone of a handwritten list of 15 soldiers he made, including their service number, rank, initials, surname and unit.

“The individual should not have taken details off that sheet,” Soldier A said of Khalife.

“They are not allowed to do that.

“Releasing that information could put those individuals at threat.”

Khalife would have known about the risks of gathering the information from his training, Soldier A said.

Daniel Khalife is accused of passing classified information to Iran’s intelligence service (Elizabeth Cook/PA)

Asked by prosecutor Mark Heywood KC what might happen to special forces or intelligence personnel if their details got out, the officer said: “That can be their whole career gone… It’s paramount for national security that we protect them and protect their identities.”

The senior officer, who admitted Khalife had “exploited a weakness in the system”, said such details would also be useful to terrorists.

In a transcript of a police interview read to the court, Khalife was asked if he had passed his list to anybody, to which he replied: “No, no, no.”

Discussing the internal spreadsheet leak, he told officers: “Even our f****** cleaner know… it gets put all over the walls.”

The former soldier is alleged to have fled his Army barracks in January 2023 when he realised he would face criminal charges over allegations he passed classified information to Iran’s intelligence service.

Later, while on remand, he is alleged to have escaped from HMP Wandsworth in September 2023 by tying himself to the underside of a food delivery truck using bedsheets.

As well as the prison escape, Khalife faces a charge of gathering, publishing or communicating information that might be useful to an enemy, namely Iranian intelligence, contrary to the Official Secrets Act between May 1 2019 and January 6 2022.

He is also accused of perpetrating a bomb hoax in Beaconside, Staffordshire, on or before January 2023.

The fourth charge alleges Khalife elicited or attempted to elicit personal information about armed forces personnel that was likely to be useful to a person committing or preparing an act of terrorism from a Ministry of Defence administration system on August 2 2021.

He denies all the charges, and the trial continues.