BAGHDAD • The fighting has finally stopped in Ramadi, a major city in the Sunni heartland.
The Islamic State in Iraq and Syria (ISIS) has been ousted, and the Iraqi flag is flying once again.
But Iraq's government defeated ISIS only with the help of Sunni tribes, which soothed local distrust of the Shi'ite-led central government. Now, as Iraq faces the even greater challenge of routing ISIS from other cities, it is confronted with a heated conflict between Iran and Saudi Arabia that threatens to inflame sectarian tensions across the entire region.
For Iraq, which barely survived years of sectarian civil war, the hostilities between Iran and Saudi Arabia could once again foil Sunni- Shi'ite cooperation - and empower the extremists of ISIS.
"For sure, the rise in sectarian tensions creates a fertile environment for the growth of ISIS," said Mr Saad al-Hadithi, a spokesman for Iraq's Prime Minister, on Tuesday. "All of this helps ISIS in building its fighting forces and getting support."
There are fears the bad blood involving regional powers Saudi Arabia and Iran will sabotage the fledgling efforts to ease the many crises roiling the region, including the civil wars in Syria and Yemen.
"I normally try to play down difficulty, but this is a huge setback," said UN Deputy Secretary-General Jan Eliasson. "It's a combination of regional geopolitical consequences and the fact that the sectarian element is playing such a role."
Iraq, in particular, finds itself in a difficult position with a central government aligned with the United States and Iran.
Iraqi Premier Haider al-Abadi has treaded carefully, cautiously condemning Riyadh's execution of a Shi'ite cleric but not heeding calls from Shi'ite protesters to cut diplomatic ties with Saudi Arabia.
Analysts, Iraqi politicians and tribal leaders say that so far, there has been no indication the regional tensions are having an immediate impact inside Iraq. They say Mr Abadi has managed to navigate a middle ground, in part because Iraq's Sunni leaders are not as closely tied to Saudi Arabia as in many other countries in the region.
"The problem between Iran and Saudi will not affect us," said Mr Rafi al-Issawi, a tribal leader in Anbar who supports the government operations against ISIS. "We have given tens of martyrs not for Iran or Saudi, but for our country."
Iraq has been making progress in mending relations with its Gulf neighbours - including Saudi Arabia - after they were soured by Saddam Hussein's invasion of Kuwait in 1990.
Mr Abadi's main task in office has been to maintain crucial ties with Shi'ite forces, often backed by Iran, which have proved more effective than the army in the fight against ISIS, while also restoring ties with the Sunni minority.
Many Sunnis' sense of neglect by the Shi'ite-led government in Baghdad helped create the opening for ISIS to seize much of the north and west of Iraq in 2014.
Mr Abadi's challenge now, as he looks north to the greater challenge of trying to retake Mosul, Iraq's second-largest city, is to retain the support of Sunni tribes.
NEW YORK TIMES