Shiite Iran offered on Saturday to consider working with long-time foe Washington if it takes the lead in helping repel Sunni Arab militants who have seized a swathe of northern Iraq.
The offer came as Iraqi commanders said soldiers had recaptured two towns north of Baghdad as they prepared a fightback, bolstered by thousands of Shiite volunteers who answered a call to arms by top cleric Grand Ayatollah Ali al-Sistani.
Prime Minister Nuri al-Maliki visited the besieged shrine city of Samarra north of the capital Friday to rally troops and pray at the Al-Askari mausoleum, a revered Shiite shrine whose 2006 bombing by Al-Qaeda sparked sectarian conflict that killed tens of thousands.
President Barack Obama said he was "looking at all the options" to halt the offensive that has brought jihadist-led militants within 50 miles (80 kilometres) of Baghdad city limits, but he ruled out any return of US combat troops.
"We will not be sending US troops back into combat in Iraq, but I have asked my national security team to prepare a range of other options that could help support Iraqi security forces," he said.
Obama has been under mounting fire from his Republican opponents over the swift collapse of the Iraqi security forces, which Washington spent billions of dollars training and equipping before pulling out its own troops in 2011.
Iranian President Hassan Rouhani, who since taking office last August has overseen a rapprochement with a superpower Tehran long derided as the "Great Satan", said his government was prepared to consider offering help.
"If we see that the United States takes action against terrorist groups in Iraq, then one can think about it," Rouhani told a news conference.
Maliki gets unlimited powers
Iraq's Shiite premier said the cabinet had granted him "unlimited powers" to reverse the offensive, in which militants swept down towards Baghdad after overrunning second city Mosul on Tuesday before losing some of its steam.
Troops found the burned bodies of 12 policemen as they recaptured the town of Ishaqi in Salaheddin province from Sunni Arab insurgents, police and a doctor said.
It was one of the closest points to the capital that the militants reached in the offensive that saw them overrun a large part of northern and north-central Iraq this week.
Troops also retook the nearby Muatassam area of Salaheddin, the colonel said.
On Friday night, police and residents expelled militants from another town in the province, Dhuluiyah, where they had set up checkpoints, witnesses said.
"Residents are now firing into the air" in celebration, witness Abu Abdullah told AFP.
Security forces have also held fast in the Muqdadiyah area of Diyala province, preventing militants from taking the town in heavy fighting, a police colonel said.
In Samarra, reinforcements were awaiting orders to launch a counter-offensive against areas north of the city, including Dur and Tikrit, seized by the militants earlier this week, an army colonel said.
North of Baghdad, gunmen on Saturday attacked a convoy carrying the head of the anti-corruption watchdog, sparking clashes that killed nine policemen, an officer said.
Security forces have generally performed poorly, with some abandoning their vehicles and positions and discarding their uniforms.
But they have been bolstered by a flood of volunteers since Sistani urged Iraqis Friday to join up to defend the country.
A representative of Sistani, who is adored by Shiites but rarely appears in public, made the call from the shrine city of Karbala, south of Baghdad.
A Qatar-based union of Sunni Muslim clerics on Saturday denounced the call, saying developments in Iraq were a "result of oppression and exclusion of people that wanted freedom".
Obama said while the US was willing to help, Iraq needed to move to heal the deep divide between the Shiite-led government and the Sunni Arab minority, whose resentment jihadists have exploited.
Washington "will not involve itself in military action in the absence of a political plan by the Iraqis that gives us some assurance that they're prepared to work together," Obama said.
"Any action that we may take to provide assistance to Iraqi security forces has to be joined by a serious and sincere effort by Iraq's leaders to set aside sectarian differences."
Watch video: Weighing Iraq options, but no US troops, says Obama
Pentagon spokesman Rear Admiral John Kirby declined to say what kind of response was being prepared.
He confirmed aircraft carrier USS George HW Bush and its strike group were nearby and ready to act. The navy said the carrier group was in the Arabian Sea.
State Department deputy spokeswoman Marie Harf dismissed Republican lawmakers' criticism a residual US force would have prevented the Iraqi army's collapse.
"When we left Iraq, after years of sacrifice and American taxpayer money, and certainly our troops felt that sacrifice more than anyone, the Iraqis had an opportunity," Harf told reporters.
Instead, Iraqi leaders "created a climate where there were vulnerabilities when it came to the cohesion of the Iraqi army," Harf said.