SARAJEVO (Reuters) - A Bosnian Muslim who pleaded guilty to terrorism charges was sentenced to four years in prison on Friday for organizing a terrorist group and fighting for Islamic State (IS) in Syria, a Bosnian court said.

Ibro Cufurovic, from the northwestern town of Velika Kladusa, has been in custody since his extradition from Syria in April. He had previously been detained for about two years by a Kurdish militia in Syria.

The court cited mitigating circumstances while explaining its ruling on Cufurovic, who had used the name Abu Kasim Albosni during his five years in Syria, where he took part in militant activities alongside other Bosnians.

“The defendant admitted he was guilty,” said Hasija Masovic, the court council’s chairwoman. “At the time when he made the decision to leave for Syria, the defendant was only 19”.

Masovic said Cufurovic had repeatedly expressed regret for his actions and had attempted to return to Bosnia, according to the defense and witnesses.

Hundreds of Bosnian citizens are believed to have left to fight for IS in Syria and Iraq. Many foreign nationals are now in detention camps waiting to be handed over to their countries of origin.

Last week, a group of 25 former IS fighters, women and children, some of them orphaned, returned to Bosnia.

Seven men were detained and questioned, while six women and 12 children, among them Cufurovic’s wife and children, were taken to a reception center for further examination and medical assistance.

Cufurovic had told the court that he fought in Syria in 2014 and 2015, but that he was detained in 2016 while trying to escape to Turkey with his family, and imprisoned.

Bosnia’s state court has tried and convicted 46 people who returned from Syria or Iraq over the past few years.