MADRID (AP) — Spain's National Court has convicted a Danish man of being a foreign fighter with the Islamic State group in Syria and sentenced him to eight years in prison.

The court said in its verdict published Monday that Ahmed Samsam was also found guilty of financing terrorism, obtaining firearms in Spain and promoting jihad on social media.

The court said the 29-year-old, who was born in Syria and acquired Danish citizenship, traveled to Syria each year in 2012, 2013 and 2014. He took part in some major battles there, including the August 2014 fight for Raqqa airport.

Samsam was arrested in the southern Spanish city of Malaga a year ago.

Since 2015, Spain's security services have arrested more than 200 people suspected of belonging to or aiding Islamic extremist groups.