Ahmed Samsam, a Danish national of Syrian origin, was arrested in Spain in 2017 and sentenced to serve eight years.

Transferred to a Danish prison in 2020, the 33-year-old is asking the Danish Eastern High Court to recognise him as a secret agent and thus help overturn the Spanish verdict.

Samsam first travelled to Syria in 2012 to fight for a rebel group. When he returned to Denmark later that year he was incarcerated for an unrelated crime.

While serving this sentence he was approached by Danish secret service PET and agreed to work on their behalf, he said in court documents obtained by Reuters.

In 2013 and 2014, Samsam travelled back to Syria twice to rejoin the rebel group. But this time, he says, with the mission of collecting intelligence on Danish foreign fighters in Syria for PET and the Danish military intelligence service FE.

Cooperation with the services was terminated when in 2015 he refused to join IS, Samsam says.

"The court can set the record straight," Samsam's lawyer Erbil Kaya said in his closing argument on Friday, according to public broadcaster DR.

PET and FE in court refused to confirm or deny that Samsam has worked for them, saying they cannot discuss identities of their informants.

The services also argued that Samsam's conviction in Spain did not depend on work he claimed to have done on behalf of Denmark.

"The circumstances emphasised in the verdict largely occurred outside of the period he claims that the collaboration took place," said Peter Biering, a lawyer representing FE and PET, according to DR.

A number of Danes have been arrested in recent years for aiding IS, including some seeking to supply drones and cash to the organisation as well as a small group of women convicted of supporting the group though marrying fighters.

(Reporting by Johannes Birkebaek, Editing by Terje Solsvik)

By Johannes Birkebaek and Jacob Gronholt-Pedersen