ADDIS ABABA, Ethiopia (AP) — South Sudan and Sudan said Saturday they struck a deal over the south's exportation of oil through Sudan's pipelines and the distribution of oil revenues, two major stumbling blocks for long-term peace between the countries that emerged from decades of war.

A disagreement over oil sharing prompted South Sudan to shut down its oil production in January. Oil also sparked a dangerous military confrontation between the two countries in April when South Sudan captured the disputed town of Heglig, which is responsible for more than half of Sudan's oil production.

South Sudan said in a statement Saturday they will pay $9.48 per barrel to use one of Sudan's pipelines. Sudan had demanded that the south should pay $36 per barrel, the statement said.

Mutrif Sidiq, the official spokesman for Sudan's delegation in the talks in Addis Ababa told The Associated Press from Khartoum, that there was an agreement on the transit fees for two different pipelines, one transporting crude for export and another that is light crude oil that goes through a refinery before going to the port. One fee agreed to was $9.48, and another was for about $11.

"The deal is accepted by both sides. Even though it falls below the expectations of both sides, it constitutes a middle ground," he said by telephone.

South Sudan said the agreement on the pipeline transportation fees will last for three and half years after which the countries may negotiate lower rates or South Sudan, which expects to have constructed a pipeline through Kenya, will stop using Sudan's pipeline.

A $3.028 billion payment will be made to Sudan by the south to compensate their neighbor for the loss of oil revenue following South Sudan's independence last year, according to South Sudan's statement. That amount is a one-off payment and compromises of a third of Sudan's financial gap resulting from the loss of South Sudan's oil revenue, it said.

Sidiq said Sudan's budget deficit reached $10.4 billion. He said it is now the turn of the international community to provide assistance, expected to be around $3.5 billion to Khartoum.

"The negotiations were very tough this round," said South Sudan's chief negotiator Pagan Amum at a press conference Saturday following his return to Juba, the capital.

Amum hailed the agreement as a victory for South Sudan and his negotiation team. "The government of South Sudan has succeeded to protect the resources of the people of South Sudan," he said.

Sudan and South Sudan are engaged in negotiations in Ethiopia hosted by the African Union over a host of issues, including the separation of their once-unified oil industry and the demarcation of the long, joint border. The negotiations have been led by former South African President Thabo Mbeki who said Saturday that the African Union has set the deadline for the end of all talks as Sept. 22. Mbeki said an African Union heads of state summit will deal with issue of the disputed oil-rich Abyei region.

Amum accused the international community of favoring Sudan at the negotiation table and during disputes between the two countries. He said the bias was most evident when Sudan began taking South Sudan's oil in lieu of unpaid transit fees from their pipelines.

"America, the U.K., all were silent. They were abetting the theft of Sudan," he said. "They (international community) were all telling us 'let it flow, let Sudan take it.' Because they don't want it to affect prices."

He also said that international pressure on the negotiations was based on desperation and the search for a "quick fix."

U.S. Secretary of State Hillary Clinton was in Juba Friday to discuss the progress of negotiations with President Salva Kiir. Clinton urged South Sudan and Sudan to reach a deal on oil as quickly as possible to resuscitate their flagging economies. She also called on South Sudan to soften its stance, urging an interim agreement on oil if a comprehensive deal could not be reached.

"A percentage of something is better than a percentage of nothing," said Clinton.

South Sudan peacefully broke away from Sudan last year after an independence vote as stipulated in a peace agreement that ended a more than two decades-long civil war in 2005, but the two sides never resolved the most contentious issues between them.

In January, South Sudan shut down its oil production after accusing Khartoum of stealing oil shipped through Sudanese pipelines for export. Sudan said it had taken the oil in lieu of transit payments for the use of its pipelines. The decision has cost both governments millions of dollars in revenue, further burdening their weak economies.

Because the south's oil travels through pipelines that run through Sudan, the decision cut off a major source of Khartoum's revenue has led to instability in that capital. But the move cost South Sudan as well. The landlocked nation derives 98 percent of its normal government budget from oil.

Sudan's Sidiq said more talks will be held after Ramadan and Eid el-Fitr, which conclude before the end of August, to discuss security arrangements and other border issues. He said the deal won't come into effect until security arrangements are in place.

In Kenya on Saturday, Clinton welcomed the oil agreement and said in a statement that it reflects "leadership and a new spirit of compromise on both sides."

"Now was the time to bring this impasse to a close, for the good of the people of South Sudan and their aspirations for a better future in the face of ongoing challenges. South Sudan's leaders have risen to the occasion," the statement said.

U.S. President Barack Obama congratulated the countries on Saturday's agreement.

"This agreement opens the door to a future of greater prosperity for the people of both countries," he said in a statement released by the White House Saturday. "The United States will continue to support efforts to advance a lasting peace for the people of Sudan and South Sudan. I encourage the parties to build on the momentum created by these breakthroughs to resolve remaining border and security issues."

The U.N. Security Council had ordered the two sides to reach agreement by Aug. 2 on such outstanding items as oil revenue sharing, the demarcation of their shared border and the status of the contested region of Abyei, which is claimed by both sides.

As part of the 2005 agreement, Abyei was to hold a referendum in January 2011 to decide whether it stays with Khartoum or joins the newly independent South. But both countries disagreed on voter eligibility, and clashed militarily over the area, forcing some 100,000 residents to flee.

South Sudan has called for a new referendum for Abyei to be held before the end of this year. The referendum would be jointly run by the United Nations and African Union and allow anyone living in Abyei for "three continuous years immediately prior to January 9, 2005" to be allowed to vote.

The U.N. Security Council ordered the two sides to hammer out agreements following clashes in April .The May U.N. resolution threatens sanctions against both sides if they did not immediately resume talks and reach a final deal within three months.


El Deeb contributed from Cairo. Associated Press writer Michael Onyiego in Juba, South Sudan contributed to this report.