European governments are worried that the Turkish operation will allow the escape of some of the 12,000 suspected Islamic State (IS) 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.
"We need to work things out with the Iraqi authorities so that we can find a way to have a judicial mechanism that is able to judge all these fighters, including obviously the French fighters," Le Drian told French TV channel BFM on Wednesday.
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.
One issue will be Iraq's use of the death penalty, which is outlawed throughout the EU.
Belgium, Britain, Denmark, France, Germany, the Netherlands and Sweden 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.
Hundreds of foreigners have been sentenced to death or life imprisonment in Iraq for belonging to IS.
Eleven French jihadists handed over to Iraqi authorities early this year by US-backed Kurdish forces in Syria were sentenced to death by a court in Baghdad.
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 fears of a public backlash.
Le Drian said Wednesday that the security of Kurdish-run prisons holding suspected jihadists in northern Syria was "currently" not threatened by the Turkish military operation.