Iraq has warned Turkey against following through with a deal to build new pipelines carrying oil and gas from Iraqi Kurdistan.

Turkey signed the pipeline deal with the Kurdistan Regional Government on Sunday, bypassing the central government in Baghdad.

We have no problem with any deals, but they have to be according to the Iraqi constitution and laws that govern relations between Baghdad and the Kurdish region, said Ali al-Moussawi, an adviser to Iraq's president, according to the BBC.

Kurdistan, a relatively unexploited oil and gas region, is locked in long struggle with Baghdad over the right to control and export its natural resources.

Since the U.S.-led invasion overthrew Saddam Hussein in 2003, the Kurds have entered into dozens of gas and oil deals, all of which have been classified as illegal by the authorities in Baghdad, who have also blacklisted the companies involved, including ExxonMobil Corp.

The warning comes a day after Baghdad told the KRG it must obtain Baghdad's approval for any oil export deals signed with Turkey.

Previously, the Kurds had agreed on a deal with the Iraqi government under which Kurdistan would transport its oil to Baghdad, which would then sell it on the international market, with each side taking half of the revenue.

However, in April, the Kurds canceled this agreement, citing a payment dispute with Baghdad.

The latest spat between Ankara and Baghdad comes amid a climate of worsening relations between the neighbors.

Turkey is sheltering the fugitive Iraqi Vice President Tariq al-Hashemi, who has been in the country since mid-April under the protection of the security services there.

Since fleeing Baghdad late last year, Hashemi was holed up in the Kurdish-controlled autonomous region of northern Iraq before moving to Turkey.