A court in Munich, the capital of the German state of Bavaria, sentenced the 23-year-old Syrian migrant only identified as Azad R to a two-year suspended sentence.
His co-defendant and friend Kamel T, 25, was sentenced to four years in prison.
According to the judge both migrants fought for the Islamic terrorist organisation Ahrar al-Sham, which aims to create an Islamic state under Sharia law and cooperated in the past with the al-Nusra Front.
They were both sentenced for membership of a foreign terrorist organisation and violating the law on war arms control.
As Azad R. was 19 at the time of the alleged crimes, he was sentenced according to juvenile criminal law. In German courts, many defendants under the age of 21 are sentenced according to juvenile law in a bid to help them reintegrate into society.
Judge Reinhold Baier said that both migrants were fully aware they joined a terrorist organisation which ‘carried out its aims with murder and manslaughter.
Baier said Kamel had radical Islamic motives, while Azad was more of a tag-along.
The two Syrian friends decided to migrate to Germany over the Balkan route after Azad was injured during the fighting in Syria’s civil war.
They fought from August 2013 to April 2014 on the front lines around Aleppo against other rebel groups as well as against government forces of Syrian dictator Bashar Al-Assad.
When Azad was injured in the fighting Kamel took care of him.
The 23-year-old was wheeled into the courtroom in a wheelchair, as the injuries have left him paralysed for the rest of his life.