Days after victory in Mosul against the Islamic State, Iran has proclaimed cooperation with Iraq, in an effort to assert Tehran’s primacy and push back other foreign powers.

Hosting Iraq’s Defense Minister Erfan al-Hiyali over the weekend, Tehran also denounced others involved in the anti-ISIS campaign such as the US and warned against independence for Iraqi Kurdistan.

Hiyali and Iranian counterpart Hossein Dehqan signed memoranda of understanding for “exchange of experience in the fight against terrorism and extremism”, improvement of border security, and provision of training and logistic and technical for the Iraqi and Iranian militaries.

“The signed MoU will set a framework for future cooperation and we hope that it would prepare the ground for serious and effective measures,” Dehqan said.

The head of Iran’s Supreme National Security Council, Ali Shamkhani, then cautioned Hiyali on Sunday against any “divisive approaches in Iraq”, saying they would “prepare the ground for the Arab country’s enemies to pursue more excessive demands and boost insecurity and instability”.

Shamkhani’s injunction was pointed both at any ongoing role in Iraq for the US, which is leading a coalition supporting the fight against ISIS, and at a likely referendum for independence in Iraqi Kurdistan.

Last week Iranian officials bluntly told Iraqi Kurdish envoys in Tehran that independence should not be countenanced. Although Tehran has links with leading Kurdish politicians as well as with Baghdad, Iran believed a separate Kurdistan would make it more difficult for the Islamic Republic to defend its interests.

Shamkhani praised the resistance of the Iraqi people, army, and “popular forces” — a reference to Iranian-supported Shia militias — against “terrorism” to reinforce his call for Iranian primacy with Baghdad and denigration of other foreign powers:

Close cooperation among countries which have been victims of terrorism in the region is an unavoidable necessity for military, security and cultural confrontation with terrorism.

It will also prevent the reemergence of terrorism and military intervention of foreigners under the pretext of fighting them.