SUDAN and South Sudan have reached a badly needed oil deal and will discuss restarting oil production soon but still need to resolve key border security issues to end hostilities, an African Union mediator said yesterday.

There was no immediate confirmation from the African arch-foes, which came close to war in April when border fighting escalated to the worst violence since South Sudan split off a year ago under a 2005 agreement to end decades of civil war.

If confirmed, an oil deal would mark a big step forward in ending a long list of conflicts left over from the messy divorce, as oil is the lifeline for both countries.

"It's an agreement about all of the (oil) matters. The issues that were outstanding were charges for transportation, for processing, transit," said former South African President and AU mediator, Thabo Mbeki.

"What will remain ... is to then discuss the steps as to when the oil companies should be asked to prepare for the resumption of production and export."

He gave no details or time frame.

The neighbours, which share a deep mistrust and have failed to implement previous arrangements, still have to resolve the thorny issue of marking their disputed border.

Landlocked South Sudan threw both economies into turmoil in January when it shut down its output of 350,000 barrels a day after failing to agree on a transit fee with Sudan, which started seizing oil to compensate for what it called unpaid fees.

Oil industry sources have said restarting oil production could take six months or longer as the pipelines have been filled with water to avoid gelling and some wells were not closed properly.

Mbeki's comments came as a surprise as the South's top negotiator, Pagan Amum, had just earlier accused Sudan of demanding a high oil fee. Both delegations had also hours earlier broken off talks without a comprehensive deal after a UN Security Council deadline expired.

He said there was enough time for both sides to settle the key security issue and other conflicts by September 22. But it was not clear how an oil deal would be implemented, as Sudan has repeatedly said it will not agree on southern oil exports before settling the border issue.

"Any agreement on oil shall be subject to the implementation of a full and final agreement on security matters," Sudan's delegation said in a position paper published on Friday.

In an indication of the mistrust between the nations, the South's negotiator Amum, speaking just before Mbeki, said Khartoum was trying to "impose very exorbitant transit fees".

Both sides had improved their offers in the past few days. South Sudan said last it was willing to pay $9.10 and $7.26 per barrel to use two pipelines crossing Sudan, alongside a $3.2 billion package to compensate for the loss of most oil reserves to the South. It had previously offered $2.6bn. Sudan itself lowered its demand to $15 a barrel per pipeline, down from $32, according to officials. It had until last week insisted on $36 a barrel.

African Union-mediated talks, led by Mbeki, have long been hampered by differences on where to draw up a demilitarised buffer zone – seen as a crucial first step to ending hostilities.