The Ugandan government has signed an agreement with the rebel Lords Resistance Army (LRA) that will see those accused of atrocities in the country's 21-year war tried at home.
The deal was signed on Tuesday in the southern Sudanese town of Juba where the two sides have been holding talks for the past 19 months.
Under the deal, those charged with severe crimes would be tried in the high court of Uganda.
The International Criminal Court (ICC) had wanted to try some suspects, but under the deal this may not materialise.
Those accused of lesser crimes would be tried through northern Uganda's traditional justice system, a spokesman for the government negotiating team said.
"We have agreed that severe crimes committed by the LRA during the war will be tried under a special division of the high court in Uganda," Chris Magezi said.
The agreement said that the special court division would also facilitate the protection and participation of witnesses, victims, women and children.
The LRA is known for brutal attacks against civilians, often burning them to death and hacking their limbs off.
More than half of its fighters are believed to be children abducted from northern Uganda.
"Less severe crimes can be dealt with using Mato Oput or even junior courts," Magezi said.
Mato Oput is a traditional reconciliation mechanism used by the Acholi people of northern Uganda.
The rebels are hiding out in north eastern Democratic Republic of Congo.
Joseph Kony, a rebel leader, and two of his commanders are wanted by the ICC in The Hague for war crimes and crimes against humanity.
The LRA has vowed not to sign a final peace deal unless Kampala can persuade the court to drop the case - something analysts say is unlikely.
However, the deal represents a major development in the difficult peace talks, for which the government and rebel representatives even consulted with ordinary citizens in northern Uganda on the issue.
David Matsanga, the leader of the rebel's negotiation team, said: "The signing of today's agreement is a sign that the peace talks are progressing towards the final stages."