Prime Minister of Iraq Nuri Al-Maliki has caused one of the biggest security challenges for his own nation and for other countries because he has not given enough space to Sunnis in his Shia-dominated government. The Islamic State of Iraq and Syria (ISIS) swept through towns in the north of Iraq, halting its advance outside the capital Baghdad on Sunday. Horrifying photographs and videos published on the Internet of massacres by the ISIS show massive executions of Iraqi soldiers. At the same time there have been reports of Iran's military intervention to confront the ISIS, some claiming that the powerful commander of the Iranian Al-Quds Force has been seen in Iraqi Kurdistan. While Iran has denied any military presence in Iraq, President Hassan Rouhani said on Saturday that if the Iraqi government asked for assistance in solving the crisis, Iran would consider cooperating. Iran has also signalled its willingness to cooperate with the US if need be, indicating that it would be willing to intervene in Iraq alongside US forces. This contrasts with earlier reports that the Iranian Revolutionary Guards were at odds with former Iranian president Mahmoud Ahmadinejad, causing diplomatic problems for Iran. It now seems that the Guards have good relations with Rouhani, meaning that the government will be powerful enough to deal with international matters. Since the election of Rouhani, the government has focussed on foreign policy, notably Iran's controversial nuclear programme. Without the Revolutionary Guards' support, Rouhani and his nuclear negotiation team would not have been able to move a finger, let alone reach a deal with the Western powers. In recent days, Iran has been getting closer to reaching a final deal with the West, and Foreign Minister Mohamed Javad Zarif has even met with long-term adversary the US, something that could not have happened without authorisation at the highest level. From Iran's point of view, the ISIS poses a regional threat by promoting Sunni-Shia confrontation in Iraq. It also knows that the group could attract Iranian Sunnis to join it, causing a national security problem. From America's point of view, the challenge is to confront an ideology like that of Al-Qaeda, since the ISIS has plans to create a radical Islamist state and challenge US interests in this part of the world. Iran has influence among Shia groups in Iraq and good relations with Al-Maliki's government, and it can mobilise these in order to collaborate with the United States. “Iran wouldn't enter this conflict on its own. It could give Iraq logistical, training and advisory support, but it would not send fighters over the frontier,” said an Iranian official. “Now there is harmony between the Revolutionary Guards and the government, meaning that the government is working closely with them on this matter,” he said. The international media has been full of speculation about possible Iran-US talks during the talks in Vienna on June 16, as US official William Burns is attending the P5+1 talks with Iran. Mohamed Javad Zarif, Iran's skilled foreign minister who has earned a great reputation among the Western powers, apparently has been authorised by the country's supreme leader Ayatollah Khamenei to stick to the matter at hand in the nuclear talks. Zarif has frequently said that he will not engage in other subjects during the nuclear talks, sticking to the red lines drawn by Khamenei for him. If Iran and the US are going to meet on the sidelines of the nuclear talks this week to talk about bilateral cooperation on Iraq, it means that Zarif has been authorised to do so by the supreme leader. If this is the case and Zarif has been authorised to conduct talks with the US on Iraq, what he agrees could be accepted by the Revolutionary Guards and could be agreed also by the US administration. On 15 June, US Senator Lindsey Graham said that Washington needed Iran's involvement to prevent a government collapse in Iraq and should open talks with Tehran. “We are probably going to need their help to hold Baghdad,” Graham, a Republican, told the US network CBS. Apparently, the US recognises the need for cooperation with Iran to stop one of the worst security crises in Iraq since the sectarian bloodshed following the toppling of former president Saddam Hussein in 2003. The foreign media has reported the presence of 130 members of the Revolutionary Guards in Iraq, deployed as an advisory team. Sources speaking on condition of anonymity confirmed that the guards were present, but said that they were there to give Al-Maliki and the Iraqi army “psychological support.” “We don't want to get involved directly. It would cost us a lot and possible cause a backlash among Sunnis in the region and provoke our own Sunni population too. Our present role is limited to intelligence, training and advice,” he said. However, in reality this is an opportunity for Iran to build trust with the US and at the same time to use US capabilities to fend off countries that are US allies but are backing the ISIS. If the ISIS retaliates for what is being called the “lost war” in Syria by striking Iran's interests in the region, then this could shift US foreign policy towards Iran in a positive way. Rouhani is no longer interested in negotiating with intermediates over Iran's interests with the US. Direct talks with the US have surprised countries in the region, and soon they may become routine. This is what Rouhani has frequently called the action of a logical and constructive government.