In an interview with Yahoo! News, Kerry said Washington is "open to discussions" with Tehran if the Iranians can help end the violence and take steps that would restore confidence in the Iraqi government. Asked about possible military cooperation with Iran, Kerry said he would "not rule out anything that would be constructive." However, he stressed that any contacts with Iran would move "step-by-step."
"We're open to discussions if there is something constructive that can be contributed by Iran, if Iran is prepared to do something that is going to respect the integrity and sovereignty of Iraq and ability of the government to reform," Kerry said.
On military cooperation, Kerry was cautious but not dismissive.
"At this moment, I think we need to go step-by-step and see what in fact might be a reality. But I would not rule out anything that would be constructive in providing real stability, a respect for the constitution, a respect for the election process and a respect for the ability of the Iraqi people to form a government that represents all the interests of Iraq," he said. "We are open to any constructive process here that would minimize the violence."
In addition to possible discussions with Iran, Kerry said that Obama administration is actively considering unilateral airstrikes to slow the ISIL insurgency that is threatening the government of President Nouri al-Maliki.
"They are not the whole answer, but they may well be one of the options that are important to be able to stem the tide and stop the movement of people who are moving around in open convoys and trucks and terrorizing people," 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."
One possible first point of contact with the Iranians could come as early as Monday in Vienna, where senior U.S. officials is meeting with an Iranian delegations as part of unrelated six-nation nuclear talks.
A senior U.S. official in Vienna said there is a possibility that Deputy Secretary of State William Burns, who is leading the U.S. delegation, may discuss Iraq with Iranian diplomats on the sidelines of the nuclear talks.
In addition to a potential channel in Vienna, officials said U.S.-Iran talks could be held in Baghdad, possibly between the two countries' ambassadors to Iraq.
Kerry's comments were met with speedy rebuke from Sen. John McCain, R-Ariz., who has been harshly critical of the administration's policy toward Iraq. In a statement, McCain said it would be the "height of folly to believe that the Iranian regime can be our partner" in Iraq.
He noted that Iran has long been deemed the world's most active state sponsor of terrorism by the State Department and argued that any greater Iranian intervention in Iraq would make matters worse and severely inflame sectarian tensions that are already near a boiling point.
McCain's position puts him at odds with fellow Republican senator Lindsey Graham of South Carolina with whom he has long shared opinions critical of Obama's foreign policy. On Sunday, Graham said that a U.S. alliance with Iran might be needed to keep Iraq from collapsing.
He said a U.S. partnership with Iran would make him uncomfortable but likened it to the United States working with Soviet leader Josef Stalin in World War II against Adolf Hitler.
With Baghdad threatened by the militants' advance, the State Department said Sunday that it was reinforcing security at the U.S. Embassy and sending some personnel out of town.
Much of the embassy staff will stay in place, the State Department said. It did not say the number of personnel affected. The embassy, along the Tigris River in Baghdad's Green Zone, has about 5,000 personnel and is the largest U.S. diplomatic post in the world.