Sudan and South Sudan have reached an agreement on how to share the oil riches controlled by Khartoum before the country’s partition, African Union mediator Thabo Mbeki has said.

“The parties have agreed on all of the financial arrangements regarding oil, so that’s done,” Mbeki told reporters on Saturday, without offering details.

“The discussions is not just about the oil, it is also about citizenship, border demarcations amongst other topics“ – Nico Plooijer, Member of the European coalition on oil in Sudan group

Mbeki said the production and export of oil would resume, but did not confirm when.

“The oil will be flowing,” he said, leaving an AU Peace and Security Council meeting in the Ethiopian capital.

“What will remain, given that there is an agreement, is to then discuss the next steps as to when the oil companies should be asked to prepare for resumption of production and export,” Mbeki added.

He said that the two sides had until September 22 to resolve the key security issue and other conflicts.

The rivals made headway in the past few days with both sides making concessions to end the oil dispute, which saw Juba shut down its production in January after Sudan took millions of barrels for what it said was unpaid fees.

“The agreement does not fulfil the ambitions of both sides,” spokesman for the Sudanese delegation Mutrif Siddig told the Sudanese state news agency. “Its implementation will start after understandings on security issues.”

Border dispute remains

While the dispute over the finances of an oil deal appears to have been resolved, border disputes remain between the two neighbours.

David Shinn, a former US ambassador to Ethiopia, and professor of International Affairs at George Washington University, told Al Jazeera there are a number of factors at play in resolving the security and border disputes.

“There was supposed to have been a referendum as to whether Abyei went with the North or went with the South, [but] the referendum never took place, and has been in dispute ever since,” he said.

“Southern Kordofan has a lot of oil, and is north of the border, but there are a lot of people living there who have sympathies to the South, and you also have an organisation the Sudan People’s Liberation Movement-North that is operating there and trying to overthrow the government in [Sudan’s capital] Khartoum. So that’s a very, very nasty issue.”

Al Jazeera’s Anna Cavell reflects on the significance of the oil deal

Nico Plooijer, from the European coalition on oil in Sudan group, said: “It is too early to celebrate, especially because the deal itself has not been signed. It is part of a larger discussion, and the delegation from Sudan has said if we don’t have an agreement on security then we will not sign.

“The discussions is not just about the oil, it is also about citizenship, border demarcations amongst other topics.”

Omar al-Bashir, the Sudanese president, will meet his South Sudanese counterpart Salva Kiir, next month to find an agreement on the flashpoint region of Abyei, said Mbeki.

“There’s an agreement between the parties that the matter of the final status of Abyei will be addressed at the next summit meeting of the presidents,” he said.

The two nations came to the brink of a full war in April after border fighting escalated, the worst violence since South Sudan became independent in July last year under a 2005 agreement that ended decades of civil war with Khartoum.

The messy divorce failed to mark the disputed border and to define how much landlocked South Sudan should pay to export its oil through the north. Oil is the lifeline of both economies.

Khartoum accuses South Sudan of supporting rebels in two of its southern border states, claims some diplomats find credible despite Juba’s denials.

South Sudan itself accuses Khartoum of often bombing its side of the border.

The AU-mediated talks on resolving the border issue have been hampered by differences on where to draw up a demilitarised buffer zone – seen as a first step towards ending hostilities permanently.

The dispute has led to as many as 170,000 people crossing the border, seeking shelter and food in the South’s Upper Nile state. Health workers in camps for the refugees say that more than half of children under two years of age are malnourished.