Iran could contemplate cooperating with its old adversary the United States on restoring security to Iraq if it saw Washington confronting "terrorist groups in Iraq and elsewhere", Iranian President Hassan Rowhani said on Saturday.
Rowhani, a relative moderate who has presided over a thaw in Iran's relations with the West, added that Tehran stood ready to provide help to Iraq within the framework of international law, but so far Baghdad had not requested such assistance.
Shiite Muslim Iran has been alarmed by the seizure this week of several major northern Iraqi towns by Sunni Islamist insurgent forces and their sweep southward to within an hour's drive of Baghdad, and not far from the Iranian border.
A senior Iranian official told Reuters earlier this week that Tehran, which has strong leverage in Shi'ite-majority Iraq, may be ready to cooperate with the United States in helping Baghdad fight back against the jihadist ISIS rebels.
"We all should practically and verbally confront terrorist groups," Rowhani told a press conference broadcast live on state television.
Asked if Tehran would work with Washington in tackling advances by Sunni insurgents in Iraq, he replied: "We can think about it if we see America starts confronting the terrorist groups in Iraq or elsewhere."
Fighters of the Islamic State of Iraq and Syria (ISIS) are bent on recreating a medieval caliphate spanning territory they have carved out in fragmenting Iraq and Syria, where it has exploited a power vacuum in the midst of civil war.
The senior Iranian official told Reuters the idea of cooperating with the Americans was being discussed within the Tehran leadership. For now, according to Iranian media, Iran will send Baghdad's Shi'ite-led government advisers and weaponry, although probably not troops, to boost Baghdad.
In Washington, U.S. President Barack Obama said he was reviewing military options, short of sending combat troops, to help Iraq repel the insurgency but warned any U.S. action must be accompanied by an Iraqi government effort to bridge divisions between Shi'ite and Sunni communities.
U.S. officials said there were no contacts going on with Iran over the crisis in Iraq.
Rowhani said Iran would consider any request for help it got from Baghdad, although he was not aware of any American plans for Iraq or whether Washington wanted to help Baghdad.
"If the Iraqi government and nation ask for our help, we will review it. So far there has not been such a request," he said. "We are ready to help in the framework of international regulations and laws."
"We have always helped to secure stability in the region, whether in Afghanistan and elsewhere in the region."
Rowhani said "terrorist groups" were getting financial and political backing and weaponry from some regional countries and some powerful Western states.
He named no countries, but was alluding in part to Sunni Gulf Arabs who Iran suspects has funneled support to ISIS.
"Where did ISIS 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."
Gulf Arab governments deny any role in backing ISIS, noting that the group has long battled Saudi Arabia's allies among other Sunni rebel factions in Syria.
Saudi Arabia last month designated ISIS a terrorist organization, conveying its concern that young Saudis hardened
by battle could come home to target the ruling Al Saud royal family - as happened after earlier wars in Afghanistan and Iraq.