ISIS_Syria_Aug2015
An Islamic State flag flies over the custom office of Syria's Jarablus border gate as it is pictured from the Turkish town of Karkamis, in Gaziantep province, Turkey on Aug. 1, 2015. Reuters/Murad Sezer

MADRID (Reuters) - Spain and Morocco arrested 14 people on Tuesday suspected of recruiting fighters to join Islamic State in Syria and Iraq, Spain's Interior Ministry said.

Suspects were detained in the outskirts of Madrid and in other cities and towns in Morocco, it added.

The arrests were linked to "a network ... capturing and sending foreign fighters to join the ranks of the terrorist organization Daesh (Islamic State) in the Syrian-Iraq region that it controls," the ministry statement said.

The operation comes days after a 26-year-old Moroccan man was accused of attacking passengers on a train in France, armed with a Kalashnikov, an assault rifle and a box cutter knife.

Spain and other countries in Europe and North Africa have said they are alarmed about the risk of locals joining militants abroad and returning to launch attacks at home.