France's top diplomat held talks in Baghdad on Thursday on transferring foreign jihadists from northern Syria for trial in Iraq after a Turkish offensive triggered fears of mass jailbreaks.

European governments are worried that the Turkish operation against Kurdish militants will allow the escape of some of the 12,000 suspected Islamic State group fighters -- including thousands of foreigners -- held by Syrian Kurds.

The issue was top of the agenda for French Foreign Minister Jean-Yves Le Drian in his talks with his Iraqi counterpart Mohammed Ali al-Hakim, President Barham Saleh and Prime Minister Adel Abdel Mahdi.

Le Drian said he had discussed with Iraqi leaders in Baghdad and Arbil, the capital of the autonomous Kurdish region, "the way to implement an appropriate judicial mechanism" to try French and other fighters "in the best conditions".

The aim is for foreign jihadists to be tried in Iraqi courts while upholding certain principles of justice and respect for human rights, a French diplomatic source said.

Rights groups have raised fears that detainees in Iraq risk torture and have no guarantee of a fair trial.

Members of the Syrian Democratic Forces stand guard over veiled women in al-Hol camp in northeastern Syria, which houses relatives of Islamic State group members
Members of the Syrian Democratic Forces stand guard over veiled women in al-Hol camp in northeastern Syria, which houses relatives of Islamic State group members AFP / Delil SOULEIMAN

European countries oppose the death penalty, but Iraq has already condemned several hundred suspected jihadists to death -- although none of those sentences have been carried out.

Iraq's foreign minister Hakim also called for "cooperation to put on trial and bring to justice foreign fighters" but his office issued a statement later saying Iraq does not want "on its soil foreign terrorists who carried out attacks outside of Iraq".

A French source said the discussions between Iraqi and French officials failed to reach an agreement.

A group of European countries sent officials on a technical mission to Baghdad this week to assess the situation.

"There are talks between the Americans, the British, French and Iraqis about funding the construction of prisons," Hisham al-Hashemi, an Iraqi expert on IS, told AFP.

Le Drian urged the international coalition against IS to confront the "new risks created by the Turkish intervention in northeast Syria and the risk of an IS resurgence."

Iraqi Foreign Minister Mohammed Ali al-Hakim (R) and his French counterpart Jean-Yves Le Drian give a press conference in Baghdad on October 17, 2019
Iraqi Foreign Minister Mohammed Ali al-Hakim (R) and his French counterpart Jean-Yves Le Drian give a press conference in Baghdad on October 17, 2019 AFP / SABAH ARAR

'Fuel chaos'

Hundreds of foreigners have been sentenced to death or life imprisonment in Iraq for belonging to IS.

Fourteen French jihadists -- including 12 transferred from Syria by US-backed Kurdish forces -- were tried in Baghdad and accused of alleged membership of the IS jihadist group.

Of the total 11 were sentenced to death, while the other three, including two women, were given life sentences.

In April, Iraq offered to try foreign IS suspects in exchange for operational costs.

One Iraqi official said Baghdad had requested $2 billion to put the suspects on trial.

Turkey on Monday accused Kurdish forces of deliberately releasing IS prisoners held at a prison in the Syrian border town of Tal Abyad "in an attempt to fuel chaos in the area".

Kurdish officials claimed that Turkish bombardments had allowed nearly 800 relatives of foreign IS fighters to escape from a camp for the displaced.

According to the Kurdish administration, there are around 12,000 suspected IS fighters in the custody of Kurdish security forces across northeastern Syria.

At least 2,500 of them are non-Iraqi foreigners of more than 50 different nationalities. Tunisia is thought to have the biggest contingent.

Officials in Paris say 60 to 70 French nationals are among those held.

The rest are around 4,000 Syrians and roughly the same number of Iraqis.

The fighters, who were detained mostly in the course of operations led by Kurdish forces and backed by the US-led coalition against IS, are detained in at least seven facilities.

Western governments such as France have been reluctant to take them back, for lack of a clear legal framework and fear of a public backlash.