(Reuters) - The United States is contemplating talks with its arch-enemy Iran to support the Iraqi government in its battle with Sunni Islamist insurgents who routed Baghdad's army and seized the north of the country in the past week.
The stunning onslaught by militants from the Islamic State of Iraq and the Levant threatens to dismember Iraq and unleash all-out sectarian warfare across a crescent of the Middle East, with no regard for national borders that the fighters reject.
Joint action between the United States and Iran to help prop up the government of their mutual ally Nuri al-Maliki, Iraq's Shi'ite prime minister, would be a major turn of events after hostility dating to Iran's 1979 revolution, and demonstrates the urgency of the alarm raised by the lightning insurgent advance.
ISIL seeks a caliphate ruled on medieval Sunni Muslim precepts in Iraq and Syria, and is also fighting Syria's Iran-backed government. It considers all Shi'ites to be heretics deserving death and has boasted of massacring hundreds of Iraqi troops who surrendered to its forces last week.
ISIL fighters captured the mainly ethnic Turkmen city of Tal Afar in northwestern Iraq overnight after heavy fighting on Sunday, solidifying their grip on the north.
"The city was overrun by militants. Severe fighting took place, and many people were killed. Shi'ite families have fled to the west and Sunni families have fled to the east," said a city official who asked not to be identified.
Tal Afar is a short drive west from Mosul, the north's main city, which ISIL seized last week at the start of its push. Fighters swept through towns and cities on the Tigris before halting about an hour's drive north of Baghdad.
Iraq's army is holding out in Samarra, a Tigris city that is home to a Shi'ite shrine. A convoy traveling to reinforce the troops there was ambushed late on Sunday by Sunni fighters near the town of Ishaqi. Fighting continued through Monday morning.
U.S. President Barack Obama pulled out all American troops in 2011 and has ruled out sending them back, although he says he is weighing other military options, such as air strikes. A U.S. aircraft carrier has sailed into the Gulf.
A senior U.S. official, speaking on condition of anonymity, said on Sunday that Washington was considering making contact with Iran to find ways to aid the Baghdad government. Publicly, the White House said no such contacts had yet taken place.
The U.S. overture came a day after Iran's President Hassan Rouhani, a relative moderate elected last year, said Tehran would consider working with the United States in Iraq if it saw Washington was willing to confront "terrorist groups".
The only U.S. military contingent on the ground is the security staff at the U.S. embassy. Washington said on Sunday it was evacuating some diplomatic staff and sending about 100 extra marines and other personnel to help safeguard the facilities.
The sprawling fortified compound on the banks of the Tigris is the largest and most expensive diplomatic mission ever built, a vestige of the days when 170,000 U.S. troops fought to put down a civil war and mass sectarian cleansing that followed the 2003 U.S. invasion which toppled Sunni dictator Saddam Hussein.
Iraqis now face the prospect of a replay of that extreme violence, but this time without American forces to intervene.
The prospect of cooperation between the United States and Iran shows how dramatically the ISIL advance has redrawn the map of Middle East alliances in a matter of days.
Rouhani has presided over a gradual thaw with the West, including secret talks with Washington that led to a breakthrough preliminary deal last year to ease sanctions in return for curbs on Iran's nuclear program. But open cooperation against a mutual threat would be unprecedented.
Iraq is the only country closely allied to both the United States and Iran, but tentative past efforts by Tehran and Washington to cooperate there were fruitless. Tehran has longstanding ties to Maliki and the Shi'ite political parties that U.S.-backed elections brought to power after Saddam's fall.
Iran blames the United States and its Gulf Arab allies for stoking Sunni militancy in the region by backing the uprising against its ally Bashar al-Assad in Syria, where ISIL emerged as one of a dominant Sunni rebel group in a three year civil war.
Asked if Iran would now work with the United States against ISIL, Rouhani told a news conference on Saturday: "We can think about it, if we see America starts confronting the terrorist groups in Iraq or elsewhere.
"Where did ISIL come from? Who is funding this terrorist group? We had warned everyone, including the West, about the danger of backing such a terrorist and reckless group," he said.
ISIL fighters began their assault last week by capturing Mosul. They swept through other Sunni cities in the Tigris valley north of Baghdad, including Saddam's hometown Tikrit, where they captured and apparently massacred troops stationed at Speicher air base, once one of the main U.S. troop headquarters.
A series of pictures distributed on a purported ISIL Twitter account appeared to show gunmen from the Islamist group shooting dozens of men, unarmed and lying prone on the ground.
Captions accompanying the pictures said they showed hundreds of army deserters captured as they tried to flee the fighting. They were shown being transported in the backs of trucks, led to an open field, laid down in rows and shot by several masked gunmen. In several pictures, the black ISIL flag can be seen.
"This is the fate of the Shi'ites which Nuri brought to fight the Sunnis," a caption to one of the pictures reads.
ISIL said it executed 1,700 soldiers out of 2,500 it had captured in Tikrit. Although those numbers appear exaggerated, the total could still be in the hundreds. A former local official in Tikrit told Reuters ISIL had captured 450-500 troops at Speicher and another 100 elsewhere in Tikrit. Some 200 are believed to be held in Speicher to trade for jailed insurgents.
Power and running water were off in the city, leaving residents dependent on water being brought in by tanker trucks.
With ISIL's advance halted on the Tigris an hour's drive north of the capital, fighters also hold most of the Euphrates valley to the west, which they captured at the start of the year, bringing them to the gates of the city of 7 million.
Shi'ites, who form the majority in Iraq and are based mainly in the south, have rallied to defend the country, with thousands of volunteers turning out to join the security forces after a mobilization call by the top Shi'ite cleric.
Baghdad itself is divided between Sunni and Shi'ite neighborhoods and suffered intense street-fighting in 2006-2007. Peace never quite returned and districts are still surrounded by barbed wire and concrete blast walls.
ISIL emerged after Saddam's fall, fought against the U.S. occupation as al Qaeda's Iraq branch and broke away from al Qaeda after joining the civil war in Syria. It says the movement founded by Osama bin Laden is no longer radical enough.
Its advance in Iraq has been assisted by other Sunni Muslim armed groups, who have risen up against Baghdad because of what they consider repression from Maliki's Shi'ite-led government. Washington says Maliki must reach out to Sunnis to create a political coalition capable of reunifying Iraq.
Tareq al-Hashemi, a Sunni who was vice president until fleeing the country in 2012 after Maliki accused him of terrorism, said Maliki must go if the uprising is to end.
"What happened is an uprising by the Sunni Arabs in Iraq to confront oppression and marginalization," Hashemi told the BBC. "Resolving the conflict in Iraq comes through excluding Maliki from power."
The government's collapse in the north has also allowed forces of the ethnic Kurdish autonomous region to advance, seizing the city of Kirkuk and rural areas with vast oil reserves.
Residents in Tal Afar said Shi'ite police and troops rocketed Sunni neighborhoods before the ISIL forces moved in and finally captured the city overnight.
"The situation is disastrous in Tal Afar. There is crazy fighting and most families are trapped inside houses. They can’t leave town," a local official said on Sunday before the city was overrun. "If the fighting continues, a mass killing among civilians could result."