The Taliban's takeover of Afghanistan overshadowed a summit in Baghdad on Saturday grouping key regional leaders as well as French President Emmanuel Macron who vowed his country would stand firm in Iraq.

The meeting comes as Iraq, long a casualty of jihadist militancy, tries to establish itself as a mediator between Arab countries and Iran.

"Given the geopolitical events, this conference has taken a special turn," Macron said at the summit.

Iraqi honour guard hold national flags ahead of a regional summit in the capital Baghdad
Iraqi honour guard hold national flags ahead of a regional summit in the capital Baghdad AFP / Ludovic MARIN

He said his country would continue to deploy troops in Iraq to battle terrorism even if the US were to withdraw.

"No matter what choices the Americans make, we will maintain our presence in Iraq to fight against terrorism," Macron told a news conference in Baghdad.

"We all know that we must not lower our guard, because Daesh (the Islamic State group) remains a threat, and I know that the fight against these terrorist groups is a priority of your government," Macron said earlier after a meeting with Iraqi Prime Minister Mustafa al-Kadhemi.

Iraqi Prime Minister Mustafa al-Kadhemi also received Qatar's Emir Sheikh Tamim bin Hamad Al-Thani, as seen in this photograh from Iraq's Prime Minister's Media Office
Iraqi Prime Minister Mustafa al-Kadhemi also received Qatar's Emir Sheikh Tamim bin Hamad Al-Thani, as seen in this photograh from Iraq's Prime Minister's Media Office IRAQI PRIME MINISTER'S PRESS OFFICE / -

Iraq and France are "key partners in the war against terrorism", Kadhemi replied.

Egyptian President Abdel Fattah al-Sisi and Jordan's King Abdullah II flew in for the summit, also attended by the foreign ministers of regional foes Iran and Saudi Arabia.

Qatar's Emir Sheikh Tamim bin Hamad Al-Thani, Dubai's ruler Sheikh Mohammed bin Rashid Al-Maktoum, Kuwait's Prime Minister Sheikh Sabah Al-Khalid Al-Sabah and Turkey's Foreign Minister Mevlut Cavusoglu also took part.

Iraqi President Barham Saleh (R) welcomes his French countepart Emmanuel Macron in Baghdad on August 28
Iraqi President Barham Saleh (R) welcomes his French countepart Emmanuel Macron in Baghdad on August 28 AFP / Ludovic MARIN

Iraq is seeking to play a "unifying role" to tackle crises shaking the region, sources close to Iraq's Kadhemi said.

The oil-rich country has been caught for years in a delicate balancing act between its two main allies, Iran and the United States.

Iraqi Prime Minister Mustafa al-Kadhemi receives Egyptian President Abdel Fattah al-Sisi in Baghdad, one of several leaders at a regional summit, seen here in a photograph released by Iraq's Prime Minister's Media Office
Iraqi Prime Minister Mustafa al-Kadhemi receives Egyptian President Abdel Fattah al-Sisi in Baghdad, one of several leaders at a regional summit, seen here in a photograph released by Iraq's Prime Minister's Media Office IRAQI PRIME MINISTER'S PRESS OFFICE / -

The Islamic republic exerts major clout in Iraq through allied armed groups within the Hashed al-Shaabi, a powerful state-sponsored paramilitary network.

Baghdad has been brokering talks since April between US ally Riyadh and Tehran on mending ties severed in 2016.

"It was really not easy to put the Saudis and Iranians in the same room," a French diplomatic source said.

An adviser to Kadhemi said that just the presence of the two foreign ministers together was itself a "success".

Leaders pose at a regional meeting in Baghdad
Leaders pose at a regional meeting in Baghdad POOL / Ludovic MARIN

The Baghdad conference "will make it possible to lay the framework for cooperation in the fight against terrorism," Macron said.

An IS affiliate claimed Thursday's suicide bombing in Kabul that killed scores of people, including 13 US service members.

The attack revived global concerns that the extremist group, which seized swathes of Syria and Iraq before being routed from both countries, is emerging anew, analysts said.

The blast came during the final days of US-led evacuations from Afghanistan after the Taliban's lightning takeover.

Macron also met separately with Qatar's emir on a possible role for Doha -- which has good contacts with Taliban having hosted peace talks -- in organising further evacuations beyond an August 31 deadline set by Washington.

The French leader told reporters that Paris was in talks with the Taliban through Qatar to "protect and repatriate" Afghans at risk.

France, which ended its evacuations from Afghanistan on Friday, had evacuated 2,834 people from there since August 17, he said.

It is now counting on Qatar to help organise further "focused" flights to evacuate "men and women whom we have identified and to whom we have given temporary (residency) permits", Macron added.

France was part of a US-led coalition established to battle IS after it announced a "caliphate" in territory seized in Iraq and Syria in 2014. It has around 800 troops deployed in Iraq.

Baghdad declared IS territorially defeated in December 2017, but the group still retains sleeper cells and continues to claim bloody attacks.

One of the deadliest was a bombing last month that ripped through a crowded market in the capital, killing over 30 people on the eve of a key Muslim holiday.

According to Colin Clarke, senior research fellow at the Soufan Center, IS "still has access to tens of millions of dollars and will likely continue to rebuild its network throughout Iraq and Syria".

In July, President Joe Biden said US combat operations in Iraq would end this year, but that soldiers would continue to train, advise and support Iraq's military in the fight against IS.

Washington currently has 2,500 troops deployed in Iraq.

On the sidelines of the summit, the Egyptian president met Qatar's emir -- their first encounter since a January summit that healed a rift that pitted Doha against Cairo and Gulf Arab countries.