A British man who fought with a Kurdish militia against the Islamic State group has been jailed for a terrorism offence and drug charges.
Aidan James of Formby, Merseyside, had no previous military knowledge when he set out for Syria in 2017.
He denied two terror offences but was found guilty of one - attending a camp in Iraq where the banned PKK group was present - at an Old Bailey retrial.
The 29-year-old was sentenced to four years in prison.
Mr Justice Edis told James the PKK is "a terrorist organisation and you knew it".
James was cleared by jurors of attending a terrorist training camp in Syria run by the non-proscribed YPG militia, then a UK ally.
He admitted two drugs offences at a previous hearing at Liverpool Crown Court which he committed before he went to Syria - possession of cocaine with intent to supply and possession of cannabis.
The judge jailed James for three years for the drug charges and imposed a consecutive 12-month sentence for the terrorism offence.
He was told he would spend half of the four years in prison and that he had already served most of that time while on remand.
The court previously heard drugs were found at James' home in April 2017 when police attended following concerns about his expressed intention to travel to the Middle East.
James, an unsuccessful applicant to the British Army, is the first Briton who fought against the Islamic State group to stand trial for such offences.
The prosecution said his intention to fight IS, and his actions in doing so, did not amount to terrorism, but that he had been present in camps where training took place for a wider ideological cause.
The retrial heard that in August 2017 after a period in a mental health facility, James flew to Iraq and spent time at an Iraqi refugee camp where the PKK was present, and later at a Syrian YPG training facility.
By the end of the year he decided to return to the UK.
He was arrested on arrival at Liverpool airport in February 2018 and charged with terror offences the following day.
Andrew Hall QC representing James, told the court the defendant had been "medically unwell" and "was also psychiatrically ill".
"He felt that he was worthless" and that "at least he would feel be was doing something positive with his life" by going to Syria, Mr Hall said.