TEHRAN - Iraqi Prime Minister Haidar al-Abadi said Tuesday his country was at war with “terrorists” threatening the region and intent on dividing Muslims, as he met top officials in key ally Iran.

As neighbours, Iran and Iraq have been close since the ouster of dictator Saddam Hussein in the US-led invasion of 2003, with Tehran’s role becoming increasingly open in recent years.

The relationship has deepened militarily after the rapid offensive by Islamic State (IS) fighters from Syria deep into Iraq this summer, which continues to pose a major threat to Baghdad.

Abadi, from Iraq’s majority, met with President Hassan Rouhani and Vice President Eshaq Jahangiri during the one-day visit. “Iraq is not fighting terrorism only. It is an extensive war with all these groups,” he said, alluding to IS and other extremist fighters such as Al-Qaeda’s Syria affiliate Al-Nusra Front.

Before the visit Abadi ruled out a foreign troop intervention against IS and appeared to impose limits on Iran’s participation also, saying in Najaf on Monday that “no regional power will fight here.”

The lightning surge by IS fighters in June led Iran to send weapons to Kurdish forces in northern Iraq and the Islamic republic has also sent military advisers across the border. The visit was Abadi’s first to Tehran since taking over after Nuri al-Maliki’s failed bid to win a new term after this summer’s IS offensive brought the country close to collapse.

Iran had resolutely backed Maliki since he took office in Baghdad in 2006, but lost faith in him after the capitulation of the Iraqi military in the face of only a few thousand IS militants. Abadi arrived in Tehran just before midnight. He was later greeted by Jahangiri at Saadabad Palace, a former residence of the Shah turned government office and museum.

The military campaign against IS, which now encompasses US and other foreign air strikes in Iraq and neighbouring Syria, will dominate his visit to Iran, though economic matters were also discussed during the meeting with Jahangiri, according to IRNA. Iran has ruled out direct cooperation with the US military in Iraq, but implicitly backed the air strikes before later saying that they were not enough to stop an IS push that has reached Baghdad’s outskirts.

Some Iraqi officials and tribal leaders in areas most affected by the unrest have argued that the world should step up its military involvement from air strikes to a ground intervention against IS. However, Abadi said the Iraqi government would not countenance such a plan.