Washington is considering direct talks with Iran on the security situation in Iraq, a US official has told the BBC.
The move comes as US President Barack Obama weighs up options on action to take in Iraq.
Meanwhile, the US condemned as “horrifying” photos posted online by Sunni militants that appear to show fighters massacring Iraqi soldiers.
In the scenes, the soldiers are shown being led away and lying in trenches before and after their “execution”.
The Iraqi military said the pictures were real, but their authenticity has not been independently confirmed.
Their emergence came as the Iraqi government claimed to have “regained the initiative” against an offensive by Sunni rebels led by ISIS – the Islamic State in Iraq and the Levant.
Extremists captured key cities, including Mosul and Tikrit, last week, but several towns have now been retaken from the rebels.
While the US and Iran are old adversaries, both have an interest in curbing the growing threat posed by ISIS and both are considering military support to the Iraqi government.
The US is said to be considering direct discussions with Tehran which could even take place as early as this week.
The two countries are due to hold the latest round of talks on Iran’s nuclear programme in Vienna.
Iranian President Hassan Rouhani has said he will consider co-operation if the US takes action in Iraq.
The USS George HW Bush aircraft carrier is already being deployed to the Gulf, accompanied by two more warships. But Washington says no US troops will be deployed on the ground.