The Ugandan government and rebels from the Lord's Resistance Army have agreed to a ceasefire in an effort to end a two-decade war.

Mediators say the truce is to go into effect early Tuesday and will allow negotiators from the two sides to continue to work towards a comprehensive peace agreement.

The deal was reached Saturday during peace talks in Juba, in southern Sudan.

Under the agreement, both sides must stop attacks and propaganda. The rebels are also required to gather at supervised assembly points within three weeks.

The Ugandan government had earlier refused to consider a ceasefire before reaching a final peace deal, saying that rebels had abused previous truces.

The war in northern Uganda has left tens of thousands of people dead and displaced more than one million others. LRA rebels are known for targeting civilians and abducting children to use as soldiers and sex slaves.

Ugandan President Yoweri Museveni has offered amnesty to rebel leader Joseph Kony and his top aides if they agree to lay down their arms.

Kony and his commanders are believed to be hiding out at bases in the Democratic Republic of Congo. They face charges of war crimes from the International Criminal Court.