BERLIN (AP) — Two Syrians have gone on trial in Berlin on allegations they fought with Islamic extremist organizations in their home country.

Abdulmalk A., 31, and Anas Ibrahim A.S., 26, who came to Germany as refugees in 2015, went on trial Thursday in Berlin state court on charges of membership in a terrorist organization. Their last names were withheld in line with privacy laws.

A. is accused of joining the Nusra Front extremist group in 2012 and becoming a commander, taking part in the capture of gas fields and the town of Tabqa. He later joined the Islamic State group and was put in charge of a strategically important dam near the city.

A.S. is accused of joining the Nusra Front in 2012 and participating in the takeover of an ammunition depot.