President Obama
U.S. President Barack Obama speaks about the situation in Iraq from the South Lawn of the White House in Washington June 13, 2014. Reuters

The United States is considering a dialogue with its long-time 'enemy' Iran as violence in Iraq continues to escalate on extreme level.

On Sunday, militants reportedly conducted harrowing mass killings in Iraq and had the nerve to post graphic photos via Twitter.

Click for photos.

Unnamed US senior officials said the talks between US and Iran will happen this week as members of other world powers convene to reach an agreement on Tehran's nuclear programme, The Wall Street Journal reports.

US needs a strong alliance with Iran to halt possible breakdown of the government of Iraq, U.S. Senator Lindsey Graham echoed on CBS Face the Nation as quoted by a report on Reuters.

"We are probably going to need their help to hold Baghdad.The Iranians have an interest. They have Shia populations to protect. We need a dialogue of some kind," Graham said.

The dialogue is needed for two important things - to save Iraq from melt down and to ensure Iran will not take the opportunity to seize control of Iran, Graham said.

However, Graham pointed out another sensitive topic that could come up from the dialogue - US partners with Iran, a country which US suspects to be developing powerful nuclear weapons.

Meanwhile, Iranian President Hassan Rouhani said that Iran will fight "terrorist groups in Iraq and elsewhere," if he sees "America starts confronting the terrorist groups in Iraq or elsewhere," a state run television reports.

"Today, in our region, unfortunately, we are witnessing violence, killing, terror and displacement. Iran will not tolerate the terror and violence ... we will fight against terrorism, factionalism and violence." Rouhani said.

High-ranking Iranian officials are also contemplating with each other the possible alliance with US, unnamed senior Iranian official revealed during an exclusive interview with Reuters.

The Islamic Republic's leadership had been discussing the possibility of alliance with US in confidentiality, the senior official said.

Iran is willing to deploy war advisers and weaponry to Iraq but will probably not send out its troops.

"We can work with Americans to end the insurgency in the Middle East. We are very influential in Iraq, Syria and many other countries," the senior official said.

"The danger of extremist Sunni terrorist in Iraq and the region is increasing ... There have been several high-ranking security meetings since yesterday in Tehran.We are on alert and we also follow the developments in Iraq very closely," the senior official highlighted.

However, House Intelligence Committee Chairman Mike Rogers, a Michigan Republican, criticized the possible alliance.

"It is too late to have long political reconciliation meetings that will last weeks or months. You have an al Qaeda army on the move," Rogers said on Fox News Sunday.

Rogers thinks that US should start organising Arab states with support from US intelligence and air strikes. In his opinion, the violence in Iraq was not just regional but that the militants are aiming for Iraq to be their base as they attack the US and Europe in the future.

US President Barack Obama on Thursday said US is willing to carry out air strikes but will avoid deploying military troops to Iraq. Australia will take the lead from US regarding the complicated issue, Australian Prime Minister Tony Abbott said.

Foreign Minister Julie Bishop said that Australia can only go as far as giving humanitarian aid to Iraq.

"At present our focus is on protecting Australian citizens and our interests in Iraq. We have been talking with our British friends who have a team on the ground. Britain is supplying sufficient humanitarian aid at this stage but we've not received a request to assist. We certainly stand ready to provide assistance should that be required," Bishop said on ABC's Radio on Monday.