A member of the Syrian Democratic Forces (SDF)

The threat of fresh attacks on the West by foreign fighters fleeing the fallen Islamic State stronghold of Raqa is set to dominate a G7 meeting of interior ministers in Italy.

The two-day gathering, which kicks off Thursday on the Italian island of Ischia, comes just days after US-backed forces took full control of the jihadists' de facto Syrian capital.

Most foreign fighters are believed to have fled over the past few months. Experts say those who stayed are now likely to head for Turkey in the hope of travelling on to Europe to seek revenge for the destruction of the "caliphate".

Tens of thousands of citizens from Western countries travelled to Syria and Iraq to fight for the group between 2014 and 2016, including extremists who then returned home and staged attacks that claimed dozens of lives.

France, whose some 1,000 nationals were among the biggest contingent of overseas recruits to join IS, stated frankly this weekend that it would be "for the best" if jihadists die fighting.

While border crossings have since tightened making it more difficult for fighters to return, security experts have warned of renewed possibilities of strikes as the pressure on IS intensifies.

"With an Islamic military defeat in Iraq and Syria we could find ourselves facing a return diaspora of foreign fighters," Italy's Interior Minister Marco Minniti told a parliamentary committee last week.

"There are an estimated 25,000 to 30,000 foreign fighters from 100 countries. Some of them have been killed of course, but... it's possible some of the others will try to return home, to northern Africa and Europe," he said.

- Catching boats to Europe -

The Syrian Observatory for Human Rights, a Britain-based monitor of the war, said a group of 130-150 foreign fighters, including Europeans, had turned themselves in before the end of the battle in Raqa.

Other reports suggested a convoy of foreign fighters had been able to escape the city towards IS-held territory, a claim denied categorically by Syrian Democratic Forces (SDF) officials.

The SDF is expected to contact the home countries of any foreign fighters it holds, to discuss the possibility of turning them over to face prosecution.

But captured fighters could prove a legal headache, with questions raised over what evidence, collected by whom, would be used in a domestic court. Jihadists also become security risks in jails for their potential to radicalise.

French European lawmaker Arnaud Danjean said Wednesday there would be "negotiations with the countries concerned" over what to do with returners.

Minniti warned fighters could take advantage of the confusion and "use the human trafficking routes" to return home -- raising the spectre of extremists embarking on the migrant boats which regularly head to Italy.

It meant controversial efforts currently spearheaded by Italy to close the land and sea trafficking routes which cross Africa into Libya and on across the central Mediterranean sea to Europe were "essential", he added.

- Intelligence war -

The Seven, from Britain, Canada, France, Germany, Italy, Japan and the United States, will also tackle the hot issue of terrorism online, with analysts warning IS's loss of territory will turn street-to-street fighting into an intelligence war.

The ministers are due to arrive Thursday afternoon at a medieval castle on the volcanic island off Naples, before retiring for an informal dinner and knuckling down to working sessions on Friday.

They are set to be joined by the EU commissioner for migration Dimitris Avramopoulos, European safety commissioner Julian King, and Juergen Stock, secretary general of the international police body Interpol.

In a G7 first, representatives from Internet giants Google, Microsoft, Facebook and Twitter will also be taking part.