(Recasts, adds details, background) By Francis Kwera JUBA, Sudan, Nov 1 (Reuters) - With hugs and handshakes all round, Uganda's government and Lord's Resistance Army (LRA) guerrillas signed a new truce on Wednesday intended to spur talks to end one of Africa's longest and most brutal wars. The deal guarantees the rebels' security at two remote locations in southern Sudan while talks continue in its capital Juba to try to resolve two decades of fighting. Both sides were accused of violating an earlier ceasefire agreed in August -- the first in a largely forgotten conflict that has killed tens of thousands of civilians and uprooted nearly 2 million more in northern Uganda alone. "We hope today's agreement creates a much better atmosphere," said the chief mediator at stop-start peace talks that began in July, south Sudan's Vice President Riek Machar. The negotiations have been hindered by deep mistrust on both sides, but after Wednesday's signing both parties were jubilant. The head of the Ugandan team, Internal Affairs Minister Ruhakana Rugunda, hugged each of the LRA delegates in turn. "This will help build confidence and further consolidates the peace process," he said. His counterpart from the LRA, Martin Ojul, agreed: "We are very happy with this agreement because it has removed some of the impediments that were disturbing us." Under August's deal, the rebels were to gather at the same two assembly points, but monitors said both sides later broke the agreement: the rebels by failing to gather, and Ugandan forces by encroaching on the eastern camp at Owiny-Ki-Bul. Under the new deal, the rebels now have another month to assemble there and at Ri-Kwangba, near the border with Democratic Republic of Congo -- this time within guaranteed "safe zones" intended to assure them of their security. "The forces of the parties shall remain as far apart as 15 km (9 miles) of the specified perimeters," the new deal says. It also banned any other groups, including journalists and diplomats, from visiting the assembly areas without the express permission of Machar himself. The rebels became notorious during their insurgency for massacring civilians, mutilating survivors and abducting thousands of children as fighters, porters and sex slaves. The International Criminal Court has issued arrest warrants for five LRA commanders. The guerrillas say they will not sign any final peace deal unless the indictments are scrapped.