When hundreds of al-Qaida fighters in armored trucks attacked the northern Iraqi town of Shirqat with machine guns last week, the local army unit called for backup and set off in pursuit.
But after a two-hour chase through searing desert heat, most militants vanished into a cluster of Kurdish villages where the Iraqi army cannot enter without a nod from regional authorities.
It was just one example of how distrust between the security forces of Iraq's central government and of its autonomous Kurdish zone helps the local wing of al-Qaida, the once-defeated Sunni Islamist insurgents who are again rapidly gaining ground, a year and a half after U.S. troops pulled out.
“We had to wait more than two hours to get the required permission to go after them,” an Iraqi military officer who took part in the operation 300 km [190 miles] north of Baghdad said. “While were we waiting, they simply disappeared.”
The Shi'ite-led Iraqi government and Kurdish authorities are now looking at examples like the Shirqat attack and considering the once unthinkable - launching joint security operations and sharing intelligence - to combat the common enemy of al-Qaida.
Such cooperation has been extremely rare since U.S. troops left at the end of 2011, while the central government and the autonomous Iraqi Kurdistan region in the north have been locked in an increasingly hostile dispute over land and oil.
That the two sides are publicly contemplating working together underlines how worried they are about the insurgency and the threat of Iraq slipping back into all-out sectarian war.
The conflict in neighboring Syria and discontent among Iraq's minority Sunnis has dramatically escalated the threat posed by al-Qaida in the past year, leading to violence unseen in Iraq since the height of the U.S.-led war five years ago.
Al-Qaida fighters, who once held sway over most of Iraq's Sunni areas until they were beaten by U.S. and Iraqi troops and their local tribal allies during the “surge” campaign of 2006-2007, are again on the ascendant.
Last year they merged with a powerful Islamist rebel group in neighboring Syria, forming the Islamic State of Iraq and the Levant. The combined group controls whole swathes of territory on both sides of the frontier and is fighting Kurds and Shi'ites alike in its goal of setting up a strict Sunni Islamist state across the heart of the Middle East.
People gather at the site of a car bomb attack in Kirkuk, 250 kilometers north of Baghdad, Iraq, Aug. 11, 2013.
In Iraq, al-Qaida fighters have been able to carry out ever more frequent and audacious attacks on government targets, culminating with a mass jailbreak last month when they attacked two prisons and sprung hundreds of militants in the biggest insurgent military operation in Iraq in at least five years.
al-Qaida militants have also claimed responsibility for waves of coordinated bombings over the past four months in Shi'ite areas of Iraq, deliberately targeting civilians and killing many hundreds.
They justify the attacks, including a wave of car bombs in recent days that killed scores of people including children during a religious holiday, with sectarian appeals against a Shi'ite-led government of “heretics”.
Each of the past four months has each been deadlier than any in the previous five years, dating back to a time when U.S. and government troops were still engaged in pitched battles with organized militiamen.
Iraq's Interior Ministry described the conflict last month as “open war”, although officials have since tried to play the violence down and insist they remain in control of the country.
Throughout, the security forces of Iraq's Shi'ite-led government have been outmatched, unable to bring security to Baghdad or protect Shi'ite areas in the south, much less sweep fighters from northern Sunni areas under their grip.
al-Qaida's presence has become strongest in parts of northern Iraq, including areas that have often been disputed between government and Kurdish forces.
Fighters now control most of the villages and towns in an area known as the Hamrin Mountains basin, which links the northern provinces of Diyala, Salahuddin, Kirkuk and Mosul, say security officials, residents and local lawmakers.
As they did before they were beaten back in the George W. Bush-era “surge”, they earn funds by extorting tribute from local businesses, giving them greater authority than the state.
Officials in Baghdad say territorial disputes with Kurdish forces are partly to blame for the inability of the government to exercise control.
“The disputed areas have become havens for al-Qaida militants and leaders. al-Qaida's biggest hotbeds are located there,” said a senior Shi'ite lawmaker and member of the Security and Defense parliamentary committee.
“The security forces have no real control over these areas, mainly because of the conflict between the central government and the Kurdistan Regional Government,” said the lawmaker, requesting anonymity.
Syria draws Kurds into conflict
The highly-trained and capable Kurdish regional security force, known as Peshmerga, would be a useful ally for Baghdad after years in which they were rivals.
While U.S. troops were active in Iraq, the Peshmerga mainly stayed out of the civil war between Sunni and Shi'ite Arabs, defending the three provinces that make up their autonomous Kurdish region in the north.
Iraq's Kurdish area has prospered while avoiding the violence that plagued the rest of the country, with the Peshmerga keeping a firm and unchallenged grip.
Kurdish territorial ambitions also extend beyond the autonomous region to Mosul, Diyala and oil-rich Kirkuk, where Peshmerga control turf and have frequently faced off with the central government's troops.
But the rise of al-Qaida in Syria and its resurgence in Iraq changes the equation and could now drag the Iraqi Kurds deeper into conflicts in both countries.
Syria has its own Kurdish minority, whose fighters have been battling against al-Qaida for control of territory there as the rebellion against President Bashar al-Assad splintered.
A Kurdish group in Syria seized the town of Ras al-Ain near the Turkish border last month after days of battle with Syrian al-Qaida fighters. The Syrian Kurdish group has raised its flag, suggesting a goal of building an autonomous Kurdish region similar to the one Kurds maintain in Iraq.
Last week, Iraq's Kurdish region announced that it was prepared to defend Kurds living in Syria if al-Qaida fighters threaten them, the first hint of possible intervention across the border.
Iraqi Kurdish officials say they are also motivated to cooperate with Baghdad against al-Qaida because they believe their own survival depends on keeping Iraq from collapsing.
“The leaders of the Kurdistan region have come to the conclusion that the fall of Baghdad would mean the fall of the (Kurdish) region,” a senior Kurdish official said, requesting anonymity while discussing the region's strategy.
Iraqi and Kurdish officials both say it was Kurdistan's regional government that took the initiative and approached Baghdad with an offer to cooperate on security.
“We have offered to cooperate, coordinate, run joint security operations and share information,” said Jabar Yawer, a spokesman for the Peshmerga, headquartered in the regional capital Arbil. “Our forces are ready to fight side by side with the Iraqi security forces to combat terrorism and control the security of Iraq - anywhere, anytime.”
That offer has been welcomed by Baghdad.
“We are now studying the details at a high level to see how to take advantage of this offer,” said Ali al-Moussawi, an adviser to Prime Minister Nuri al-Maliki.
In a country where political alliances shift like sand, any cooperation is still likely to be tentative. The Kurdish authorities are suspicious of Maliki who they feel has reneged on political promises in the past.
Baghdad will be wary of Iraqi Kurds growing closer to their Syrian kin. And Maliki's government is likely to be suspicious of Kurdish forces extending the boundaries of the territory under their control, especially in areas where underground oil reserves are disputed.
One country which appears to have little leverage is the United States. The sudden surge in violence has drawn attention to Washington's swift exit, a decade after its invasion to overthrew dictator Saddam Hussein unleashed sectarian bloodshed in which some 100,000 Iraqis were killed.
U.S. President Barack Obama took office in 2009 after Iraq's violence had abated. He fulfilled a campaign pledge to withdraw troops almost as quickly as they could pack up and leave, pulling the last out at the end of 2011.
The Obama administration had hoped to keep a smaller force in Iraq for counter-terrorism to fight the remnants of al-Qaida, but failed to negotiate terms with Maliki's government, which refused to grant U.S. soldiers immunity from Iraqi law.
Today, Washington operates its largest embassy in a massive fortress-like compound built during the war, which dominates central Baghdad on the banks of the Tigris.
But its ability to influence events is largely limited to pressing the Iraqi government to act more effectively, said Aaron Zelin, who researches jihadist groups for the Washington Institute for Near East Policy.
“We have to understand that the U.S. ability to shape events is not as great as people like to think sometimes, especially since I'm pretty sure most Iraqis don't want the U.S. to go back in there,” he said.
After the latest wave of bombings over the Muslim Eid holiday celebration in Iraq killed scores of people on Saturday, Washington reiterated a $10 million reward for Abu Bakr al-Baghdadi, head of the combined Iraq and Syria al-Qaida branch.
“We have seen an uptick in recent months in al-Qaida in Iraq and in terrorist attacks in Iraq, so we will continue working with the security forces and on counter-terrorism,” U.S. State Department spokeswoman Mari Harf said. “We will look for new ways to cooperate on counter-terrorism.”