(Adds details, background, quotes)
By Tim Cocks
KAMPALA, June 30 (Reuters) - Uganda's government and Lord's Resistance Army (LRA) rebels have signed an agreement on how to deal with war crimes in the third phase of talks to end one of Africa's worst conflicts, the rebels said on Saturday.
The signing, at negotiations in southern Sudan, was a major development in an intended five-stage peace deal aiming to end two decades of violence in north Uganda.
"We signed the agreement on reconciliation and accountability late last night, which moves us one step closer to a final peace agreement," Martin Ojul, head of the LRA delegation in Sudan, told Reuters by telephone.
Talks between the two sides started last July, raising hopes of an end to a war that has caused tens of thousands of deaths and forced nearly two million refugees into camps that aid workers say are among most squalid in the world.
Progress had been slow since a truce signed in August, with the LRA frequently walking out of talks, but have since picked up pace. Last month, the two sides signed the second stage of the deal, breaking months of deadlock.
The third phase is supposed to set out principles for dealing with war criminals -- a thorny subject for a rebel group notorious for beating civilians to death, mutilating victims and kidnapping children.
LRA leader Joseph Kony and three other top commanders are wanted in the International Criminal Court (ICC) in The Hague and have vowed never to quit their Congolese jungle hideouts unless the court drops the indictments.
Ugandan government officials were unavailable for comment, and the document was not immediately available. Ojul said it set out a framework for dealing with war crimes under Uganda's own law that they hoped would appease judges in the ICC.
"The agreement is about putting mechanisms in place under national law. We can take it to the ICC and say 'look: we are dealing with accountability'," he said.
Analysts say the trial of Liberian former president and warlord Charles Taylor in a special tribunal, also in The Hague, has shaken up the LRA leadership.
The LRA says the ICC indictments are too one-sided and fail to acknowledge crimes committed by government forces.
Leaders from Kony's Acholi tribe want him and his associates to undergo a traditional reconciliation ritual in which the murderer faces relatives of the victim and admits his crime before both drink a bitter brew made from a tree root.
Rights groups say such a method would condone impunity.
"There's nothing we signed that explicitly deals with punishment," Ojul said. "It is trying to find a way of dealing with war crimes locally. We don't see the ICC as appropriate."

