Iraq's prime minister says his country and neighboring Turkey have agreed on closer security and intelligence cooperation in the face of the threat posed by the extremist Islamic State group.

Prime Minister Haider al-Abadi spoke on Thursday at a Baghdad news conference after talks with his visiting Turkish counterpart, Ahmet Davutoglu.

About a third of Iraq, which shares a porous border with Turkey, is held by the Islamic State group that earlier this year declared a caliphate on the large swaths of territory under its control in both Iraq and Syria.

Relations soured between the two neighbors recently over what Baghdad sees as illegal oil exports by its Kurdish self-ruled northern region through Turkey.

Al-Abadi says the two countries have reached an agreement on the issue but did not elaborate.