Iraq's government and the autonomous Kurdish region announced Tuesday an agreement resolving their longstanding disputes over the budget and oil exports, boosting prospects of closer cooperation against jihadists.
Despite months of bad blood, the deal shows that the federal and Kurdish regional government still need each other.
Plummeting oil prices are financially squeezing the Baghdad government and Arbil is in desperate need of cash to pay its civil servants and shore up its security forces.
Iraqi Prime Minister Haider al-Abadi's office said the deal was approved during a cabinet meeting attended by Kurdish Prime Minister Nechirvan Barzani.
Under the deal, due to take effect at the start of next year, 250,000 barrels per day of oil will be exported from the autonomous region and another 300,000 bpd from the disputed province of Kirkuk.
"We have reached an agreement with the Iraqi government which will benefit both parties and whereby we will export 250,000 bpd of regional oil and help the federal government export the Kirkuk oil," Barzani told reporters.
Oil from the Kurdish region or claimed by its leadership will be shipped out via Kurdish pipelines but through the federal oil company.
In return, Baghdad will release the regional government's share of national revenue, which had been frozen for more than a year in retaliation for Arbil's efforts to export oil unilaterally.
The federal government will also give a share of its military budget to the Kurdish peshmerga fighters.
"The federal prime minister has expressed his readiness to guarantee one billion dollars from the Iraqi budget for the peshmerga forces," Barzani said.
Abadi's office simply said the Kurdish military would get a percentage of the federal defence budget.
The peshmerga have played a key role in the counter-offensive against the Islamic State (IS) jihadist group, which controls parts of Syria and conquered swathes of Iraq in June.
The jihadists exploited the dispute between Baghdad and Arbil to establish a presence in disputed regions along the borders of the Kurdish region.
When the federal army collapsed and retreated in the face of the IS advance in June, Kurdish troops took over federal areas it had long claimed -- including the oil hub of Kirkuk -- infuriating Baghdad.
But two months later, IS made a fresh push and seized some of those disputed areas from the peshmerga, moving within striking distance of Arbil.
Relations improved when Abadi succeeded Nuri al-Maliki as prime minister.
IS was ousted from two towns in eastern Iraq last month in joint operations that saw peshmerga forces move in from the north and federal troops backed by Shiite militia push up from the south.