The Iraqi federal government and the Kurdish regional government in northern Iraq have reached an agreement Thursday over longstanding oil and budget disputes that for months have created a rift between the two sides.

The government in Irbil, the capital of the semi-autonomous Kurdish region, agreed to sell 150,000 barrels of oil per day to the federal government in return for a one-time payment of $500 million, the Kurdish government said in a statement on its official website.???

Earlier this year, Baghdad cut the 17 percent of the state budget that is supposed to go to the Kurdish region -- which in 2013 totaled about $12 billion, according to Minister of Finance Hoshyar Zebari. The central government withheld the funds after the Kurds began transporting oil from fields inside the autonomous zone to Turkey against Baghdad's wishes. The Kurdish government says it needs that money to meet its growing security demands, particularly amid the current fight against the Islamic State group, and to pay public-sector employees and fund much-needed infrastructure development

"We hope for improvement from here," Sharko Jawdat, a lawmaker in the Kurdish parliament and member of the Kurdish parliament's oil committee, said in an interview. "There should be a legal solution to these problems."

The Kurds and Baghdad have feuded for years over a host of issues, chief among them the rights to oil resources in the north and disputed territory. Yet, they have also found room for compromise, and the Kurds provided critical backing to help former Prime Minister Nouri al-Maliki become prime minister. Since his successor Haider al-Abadi came to power in October, the Kurds have pushed for a quick resolution, saying they will give him three months to resolve the outstanding dispute or they would boycott his government.

"There have been concessions made by both sides," Zebari, a veteran Kurdish politician, told The Associated Press. "But it is a big breakthrough. We've worked very hard on this agreement to bring both sides to a point of reason."