A Munich court on Tuesday convicted two former Syrian rebel fighters who came to Germany as refugees.

Kamel T., 25, was sentenced to four years in prison, while his friend Azad R., 23, was given two years' parole due to his age at the time of the crime.

The two were accused of being members of a foreign terrorist organization in Syria, where they fought alongside the Salafist Ahrar al-Sham militant group. They also violated the German laws on the use of weapon in foreign war zones.

The charges stem from the two Syrians' role as sentries for Ahrar al-Sham in Aleppo between August 2013 and April 2014. During this time Ahrar al-Sham fought the Syrian military and other rebel factions.

Azad R. was wounded in the leg in clashes that left him partially paralyzed. His friend cared for him as the two came through the Balkan migrant route, arriving in Germany in 2015.

Read: Two years since Germany opened its doors to refugees

Last year the two were arrested at a refugee center in Bavaria.

The case is the first in Bavaria concerning refugees who fought with terrorist groups in Syria.

The defense argued that the two Syrians were not members of a terrorist organization and did not promote the establishment of an Islamic state governed by Sharia.

Backed by Turkey and Gulf Arab states, Ahrar al-Sham is one of the largest Syrian rebel factions. It formerly cooperated with the al-Qaeda linked al-Nusra front, which has since formed into the Hayat Tahrir al-Sham umbrella group of Islamist rebels.

Ahrar al-Sham and Hayat Tahrir al-Sham are rivals and have repeatedly clashed in recent months.

cw/kl (dpa, Bayerischer Rundfunk)