A man who fought against Isis in Syria has been jailed for a terror offence in a landmark court case.

Aidan James denied the charges but was convicted following a retrial.

The 28-year-old was convicted of one count of attending a place used for terrorist training in Iraq, because the banned Kurdistan Workers’ Party (PKK) had been present.

A jury acquitted him of a second count of the same offence, over training with the Kurdish People’s Protection Units (YPG), in Syria.

He was jailed for 12 months for the terror offence and three years for an unrelated offence of cocaine possession with intent to supply, which could not be reported during proceedings.

Timeline of the Isis caliphate Show all 19 1 /19 Timeline of the Isis caliphate Timeline of the Isis caliphate ISIS began as a group by the merging of extremist organisations ISI and al-Nusra in 2013. Following clashes, Syrian rebels captured the ISIS headquarters in Aleppo in January 2014 (pictured) AFP/Getty Timeline of the Isis caliphate Abu Bakr Al-Baghdadi declared the creation of a caliphate in Mosul on 27 June 2014 Timeline of the Isis caliphate Isis conquered the Kurdish towns of Sinjar and Zumar in August 2014, forcing thousands of civilians to flee their homes. Pictured are a group of Yazidi Kurds who have fled Rex Timeline of the Isis caliphate On September 2 2014 Isis released a video depicting the beheading of US journalist Steven Sotloff. On September 13 they released another video showing the execution of British aid worker David Haines Timeline of the Isis caliphate The US launched its first airstrikes against Isis in Syria on 23 September 2014. Here Lt Gen William C Mayville Jnr speaks about the bombing campaign in the wake of the first strikes Getty Timeline of the Isis caliphate Isis militants sit atop a hill planted with their flag in the Syrian town of Kobani on 6 October 2014. They had been advancing on Kobani since mid-September and by now was in control of the city’s entrance and exit points AFP/Getty Timeline of the Isis caliphate Residents of the border village of Alizar keep guard day and night as they wait in fear of mortar fire from Isis who have occupied the nearby city of Kobani Getty Timeline of the Isis caliphate Smoke rises following a US airstrike on Kobani, 28 October 2014 AFP/Getty Timeline of the Isis caliphate YPG fighters raise a flag as they reclaim Kobani on 26 January 2015 VOA Timeline of the Isis caliphate Isis seized the ancient Syrian city of Palmyra on 20 May 2015. This image show the city from above days after its capture by Isis Getty Timeline of the Isis caliphate Kurdish forces are stationed on a hill above the town of Sinjar as smoke rises following US airstrikes on 12 November 2015 AFP/Getty Timeline of the Isis caliphate Kurdish forces enter Sinjar after seizing it from Isis control on 13 November 2015 AFP/Getty Timeline of the Isis caliphate Iraqi government forces make the victory sign as they retake the city of Fallujah from ISIS on 26 June 2016 Getty Timeline of the Isis caliphate Iraqi forces battle with Isis for the city of Mosul on 30 June 2017 AFP/Getty Timeline of the Isis caliphate Members of the Iraqi federal police raise flags in Mosul on 8 July 2017. On the following day, Iraqi prime minister Haider Al Abadi declares victory over Isis in Mosul Getty Timeline of the Isis caliphate Members of Syrian Democratic Forces celebrate in Al-Naim square after taking back the city of Raqqa from Isis. US-backed Syrian forces declare victory over Isis in Raqqa on 20 October 2017 after a four-month long campaign Getty Timeline of the Isis caliphate Female fighters of the Syrian Democratic Forces celebrate in Al-Naim Square after taking back the city of Raqqa from Isis. US-backed Syrian forces declare victory over Isis in Raqqa on 20 October 2017 after a four-month long campaign AFP/Getty Timeline of the Isis caliphate Trucks full of women and children arrive from the last Isis-held areas in Deir ez-Zor, Syria in January 2019 They were among the last civilians to be living in the ISIS caliphate, by this time reduced to just two small villages in Syria’s Deir ez-Zor Richard Hall/The Independent Timeline of the Isis caliphate Zikia Ibrahim, 28, with her two-year-old son and 8-month-old daughter, after fleeing the Isis caliphate, on Saturday 26 January 2019 Richard Hall/The Independent

James denied anything other than an “incidental association” with the PKK and said he did not fight for the banned organisation, instead joining the YPG as it was supported by the US-led coalition to push Isis out of its territorial “caliphate”.

The first jury to consider his case could not reach a verdict in April, amid questions over why James was prosecuted from other British citizens were not.

Several British people who joined the YPG have been arrested and questioned by counterterror police, with some having their passports and phones seized, but faced no further action.

Eight British volunteers with the group – seven men and one woman - were killed in action.

One volunteer, former soldier James Matthews, was also charged with “attending a place used for terrorist training” but the case was dropped before trial last year.

A third YPG volunteer, Joshua Walker, was acquitted of an unrelated terror offence after police found a copy of the Anarchist Cookbook while searching his home.

Prosecutors alleged that James “set out to advance a political and ideological cause” by joining the YPG, and initially charged him with preparing acts of terrorism.

But a judge found that he had “no case to answer” on that charge, because fighting against Isis with the YPG was not terrorism.

Sentencing James at the Old Bailey in London on Thursday, Mr Justice Edis noted that the Kurdish group was “supporting the policy of the UK and other allies by fighting Isis” and was supported by the RAF.

Funeral for British Kurdish YPG fighter killed by ISIS sees procession in liberated Syria

The judge said James was solely convicted for attending a camp where PKK fighters were training, and that fighting alongside the YPG “was not terrorism at all”.

Justice Edis said James deliberately travelled to a training camp that was “operated by the PKK for their benefit” in Makhmour, Iraq, in October 2017.

“The offence is less serious than others because of the very limited extent to which you assisted or supported the PKK,” he said, adding that it was “not an ordinary case”.

“Attendance for any purpose at a camp where weapons training for terrorist purposes is provided is an offence, and there is no defence of reasonable excuse. The policy of the law is to keep people who are subject to the criminal law of the UK away from such places altogether.”

The judge said he had been warned not to fight in Syria by police officers from the Prevent counter-extremism programme, but was in a “fragile mental state”. According to an officer's notes of a meeting in April 2017, James said he wanted to help the “PKK YPG” in their battle against Isis and they warned him that he could be investigated for criminal offences.

In a Facebook post, he announced his intention to travel to “Syria fighting side by side with brothers in arms against the sick regime and ideologies of the so-called Daesh [Isis] and other Islamic extremists”.

“I don’t care for people’s opinions, this is what I want to do and need to do,” James added.

He was arrested later that month, but his bail was later cancelled and no further action was taken.

During his police interview James claimed he was going to Syria to help with “humanitarian aid” and dismissed the suggestion he was going for terrorism as “ridiculous”.

“Nothing will stop me going, even if you take my passport off me I will still find a way to go,” he told police.

"I cannot sit at home and watch people getting f***ing butchered because it's another country."

Kurdish YPG fighters in Syria (EPA)

The defendant said he was ”ripped“ from 11 years of kickboxing training, but had been turned down by the Army, RAF, Navy and Territorial Army because of his mental health.

The father-of-one put his plans on hold, but set off for Iraq in August 2017 after his bail was cancelled and passport returned.

James later underwent a month-long YPG training course in Syria before being deployed to fight against Isis in Deir ez-Zor, taking part in battles to regain occupied towns.

As he prepared to come home, James wrote in his diary of his "amazing time", adding: "Lost good friends, met great ones, fought on front line numerous times, killed Daesh soldiers, been shot at many times by Isis and our own guys.

“Drove humvys [sic], sat on roof as drove through desert, attacked by suicide vehicles many times, mortar fire, sniper RPG, drones, chilled with donkey.”

The court heard a police negotiator was in regular email contact with James, assuring him over Christmas 2017 that officers could assist his return to Liverpool and “support you through that process”.

James was arrested after returning to Liverpool John Lennon airport on 14 February last year on flights via Baghdad, Amman and Amsterdam.

He denied terror offences but pleaded guilty to possessing cocaine with intent to supply, after the class A drug was found during his April 2017 arrest.

Justice Edis said he was a “street level dealer with a significant role in a small-scale operation”, and had been offending to fund his own habit.

“A psychiatric report shows that you suffer from some psychiatric conditions related to traumatic experiences you have suffered, but also to substance abuse,” the judge added.

“I have read the letters from your mother and sister and I think you owe it to them to make the best of yourself when you are released.”