Turkish Prime Minister Ahmet Davutoglu has met with leaders in Iraq's Kurdistan capital of Erbil, his second stop in the violence-plagued country after Baghdad, as he continues the bond-building visit.

In talks with the Kurdish region's President Masoud Barazani on Friday, energy and military cooperation were discussed following a visit seen as a solution to long-standing tensions between Ankara and Baghdad.

"I'm very happy to be visiting Erbil as prime minister," Dabutoglu said, adding that discussions had focused on humanitarian aid to Iraq's IDPs and security as well as economic cooperation.

"I would like to reiterate that Turkey will continue to look after its brothers," he said, in reference to those forced to flee ISIL. "We have built camps in Duhok with a total capacity of 35,000 people."

Al Jazeera's Imran Khan, reporting from Baghdad, described the visit as a "positive" one in which "concrete steps" were achieved.

Speaking at a joint news conference in Erbil, Barazani confirmed that 150,000 barrels per day of crude oil from the Kirkuk oilfields will begin to flow into Turkey.

"This is a massive step, since Turkey has no domestic energy output of its own, and therefore relies on imports," our correspondent said.

"Money revenue from this transaction was held effectively in escrow, where it was not touched by neither the Kurds, nor Baghdad, but has now been released to Baghdad." 

Turkey shares a border with the Kurds, who are involved in battles against the Islamic State in Iraq and the Levant (ISIL), an armed group that is seeking to establish a caliphate. 

Military assistance

Security was also a major issue in the Turkish premier's talks with his Iraqi counterpart Haidar al-Abadi in Baghdad on Thursday.

Davutoglu "offered Turkish military assistance to Iraq," Abadi said at a joint news conference on Thursday, later adding that this could include arming and training members of Iraq's planned national guard.

Iraqi volunteer forces "need training and we may discuss training these forces in neighbouring Turkey," Abadi said. The Iraqi premier also said that he agreed to visit Turkey next month.

Davutoglu's trip to Iraq follows a visit to Turkey by Iraqi Foreign Minister Ibrahim al-Jaafari earlier this month that was aimed at patching up the strained ties between the two neighbours.

Recep Tayyip Erdogan, now Turkey's president, also repeatedly clashed with Abadi's predecessor, Nouri al-Maliki.

The two countries have also disagreed over the protracted Syrian civil war, where mostly-Sunni rebels are seeking to overthrow President Bashar al-Assad.

Shia-majority Iraq is seen to prefer al-Assad, whose Alawite sect is an offshoot of Shia Islam, while Sunni Muslim Turkey backs the rebel groups.

Previous attempts to patch up Iraqi-Turkish relations were unsuccessful but prospects appear improved now that the two countries both have new governments.

"Turkey has always favoured a government inclusive of all of Iraq's ethnic and religious groups. No-one should be excluded from the political arena. A united Iraq must be built," Davutoglu said.

Source: Al Jazeera and agencies