(Adds U.N. on summary executions)
* Kerry says Washington considering cooperation with Tehran
* U.N. accuses Islamists of war crimes
* ISIL fighters capture northwestern town of Tal Afar
* ISIL advance has halted north of Baghdad
* Shi'ite volunteers rally to defend state
By Ziad Al-Sanjary and Susan Heavey
MOSUL, Iraq/WASHINGTON, June 16 (Reuters) - The United States said it could launch air strikes and act jointly with its arch-enemy Iran to support the Iraqi government, after a rampage by Sunni Islamist insurgents across Iraq that has brought accusations of war crimes.
Militants from the Islamic State of Iraq and the Levant have routed Baghdad's army and seized the north of the country in the past week, threatening to dismember Iraq and unleash all-out sectarian warfare with no regard for national borders.
The fighters have been joined by other armed Sunni groups who oppose what they say is oppression by Prime Minister Nuri al-Maliki, a Shi'ite.
The United Nations human rights chief said forces allied with ISIL had almost certainly committed war crimes by executing hundreds of non-combatant men in Iraq over the past five days
Joint action between the United States and regional Shi'ite power Iran to help prop up their mutual ally in Baghdad would be unprecedented since Iran's 1979 revolution, demonstrating the urgency of the alarm raised by the lightning insurgent advance.
U.S. Secretary of State John Kerry called the advance an "existential threat" for Iraq. Asked if the United States could cooperate with Tehran against the insurgents, Kerry told Yahoo News: "I wouldn't rule out anything that would be constructive."
As for air strikes: "They're not the whole answer, but they may well be one of the options that are important," he said. "When you have people murdering, assassinating in these mass massacres, you have to stop that. And you do what you need to do if you need to try to stop it from the air or otherwise."
The Pentagon said that while there might be discussions with Iran, there were no plans to coordinate military action with it.
Britain, Washington's ally in the 2003 war that deposed Sunni dictator Saddam Hussein, said it had reached out to Iran in recent days. A U.S. official said meetings with Iran could come this week on the sidelines of international nuclear talks.
Iran has longstanding ties to Maliki and other Shi'ite politicians who came to power in U.S.-backed elections.
ISIL seeks a caliphate ruled on mediaeval Sunni Muslim precepts in Iraq and Syria, fighting against both Iraq's Maliki and Syria's Bashar al-Assad, another ally of Iran. It considers Shi'ites heretics deserving death and has boasted of massacring hundreds of Iraqi troops who surrendered to it last week.
Its uprising has been joined by tribal groups and figures from Saddam's era who believe Maliki is hostile to Sunnis.
ISIL fighters and allied Sunni tribesmen overran yet another town on Monday, Saqlawiya west of Baghdad, where they captured six Humvees and two tanks.
Eyewitnesses said Iraqi army helicopters were hovering over the town to try to provide cover for retreating troops.
"It was a crazy battle and dozens were killed from both sides. It is impossible to reach the town and evacuate the bodies," said a medical source at a hospital in the nearby city of Falluja, largely held by insurgents since early this year.
Overnight, the fighters captured the city of Tal Afar in northwestern Iraq, solidifying their grip on the north.
"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.
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 then 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 travelling to reinforce the troops there was ambushed late on Sunday by Sunni fighters near the town of Ishaqi. Fighting continued through Monday morning.
An Iraqi army spokesman in Baghdad reported fighting also to the south of Baghdad. He said 56 of the enemy had been killed over the previous 24 hours in various engagements.
OBAMA WEIGHING OPTIONS
President Barack Obama pulled out all U.S. troops in late 2011 and rules out sending them back, although he is weighing other options such as air strikes. A U.S. aircraft carrier has sailed into the Gulf along with a warship carrying 550 marines.
The only U.S. military contingent on the ground is the security staff at the U.S. embassy. Washington is evacuating some diplomatic staff and sending about 100 extra marines and other personnel to help safeguard the facilities.
The United Nations said it had relocated 58 staff to Jordan.
Potential 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.
Iran's President Hassan Rouhani, a relative moderate elected last year, has presided over a gradual thaw with the West, including secret talks with Washington that led to a preliminary deal to curb Iran's nuclear programme. But open cooperation against a mutual threat would be unprecedented.
Any rapprochement between Washington and Tehran over Iraq could anger U.S. allies Israel and the Sunni Gulf Arab states. Saudi Arabia, the Gulf's main Sunni power, said it rejected foreign interference in Iraq, and blamed Baghdad's "sectarian and exclusionary policies" for fuelling the insurgency.
ISIL fighters' sweep through the Tigris valley north of Baghdad included 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.
Pictures distributed on a purported ISIL Twitter account appeared to show gunmen from the Islamist group shooting dozens of men, unarmed and lying prone. Captions said they were army deserters captured as they tried to flee fighting.
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 troops were still believed to be holding out in Speicher.
U.N rights chief Navi Pillay said corroborated reports showed that soldiers, military conscripts, police and others who had surrendered or been captured had been summarily executed.
"Although the numbers cannot be verified yet, this apparently systematic series of cold-blooded executions, mostly conducted in various locations in the Tikrit area, almost certainly amounts to war crimes," she said.
Washington has urged Maliki to reach out to Sunnis to create unity, but the prime minister has spoken more of retaliation than reconciliation. He was shown on television on Monday meeting military chiefs, vowing to crush the uprising and root out politicians and officers he blamed for betraying Mosul.
"We will work on purging Iraq of the traitors, politicians and those military men who were carrying out their orders," he said.
Shi'ites, who form the majority in Iraq based mainly in the south, have rallied to defend the country, turning out in their thousands to join militia and the security forces after a mobilisation call by the top Shi'ite cleric, Ali al-Sistani.
A leading Sunni cleric, Rifa al-Rifaie, said Sistani's call amounted to sectarianism. Sistani is known as a moderate who never called his followers to arms during the U.S. occupation.
"Sistani, that lion, where was he when the Americans occupied Iraq?" Rifaie said. He gave a list of Sunni grievances: "We have been treated unjustly, we have been attacked, our blood had been shed and our women have been raped."
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.
Tareq al-Hashemi, a Sunni who was vice president until fleeing the country in 2012 after Maliki accused him of terrorism, said the violence was part of a broader Sunni revolt that could lead to a holy war, and was not just a rampage by Islamist militants.
"What happened in my country ... is desperate people revolted. Simple as that. Arab Sunni communities over 11 years faced discrimination, injustice, corruption," he told Reuters in an interview on Monday. (Additional reporting by Isabel Coles and David Sheppard in Arbil, Raheem Salman, Ahmed Rasheed, Oliver Holmes and Ned Parker in Baghdad, Alexander Dziadosz and Samia Nakhoul in Beirut, Missy Ryan and Jim Loney in Washington, Tom Miles in Geneva, and Nick Tattersall in Istanbul; Writing by Peter Graff; Editing by Alastair Macdonald and Giles Elgood)