The US has discussed the current situation in Iraq with Iranian officials on the sidelines of nuclear talks in Vienna, officials here said.

"We are open to engaging the Iranians, just as we are engaging other regional players on the threat post by ISIL in Iraq. The issue did come up briefly with Iran on the margins of the P5+1 in Vienna today, separate from our trilateral meeting," a Senior State Department official said.

"These engagements will not include military coordination or strategic determinations about Iraq's future over the heads of the Iraqi people," the official said on the condition of anonymity.

"We will discuss how ISIL threatens many countries in the region, including Iran, and the need to support inclusivity in Iraq and refrain from pressing a sectarian agenda," the official said yesterday.

Earlier in the day, the White House, the State Department and the Pentagon ruled out holding any talks with Iran on military operations in Iraq.

"I want to make very clear that any of those conversations that may occur on the margins are entirely separate from the conversations about Iran's nuclear programme," White House Deputy Press Secretary, Josh Earnest, told reporters.

According to published reports, it's clear the Iranians feel a stake in resolving the deteriorating security situation that we've seen in Iraq.

"Frankly, it’s in the interest of all of the countries in the region that the kind of violence at the hands of extremists that we've seen in Iraq come to an end," he said.

"The message that we are sending publicly about the need for all of Iraq's political leadership to pursue an inclusive political agenda is a position that will be conveyed candidly to the Iranian leadership if those kinds of conversations actually occur," he said.