Rebels in the Democratic Republic of Congo have started withdrawing from two towns captured from government troops after a deal was brokered by Uganda.

The M23 group is giving up gains from a lightning offensive carried out in the past week, but there was no indication it was ending its eight-month-old insurgency.

The revolt against Congo's government has raised the risk of all-out war in a borderlands region dogged by nearly two decades of conflict that has killed about five million people and is fuelled by competition over mineral resources.

"We're leaving Sake, we're leaving Masisi," M23 military leader Sultani Makenga told reporters in rebel-held Goma, the provincial capital of North Kivu.

"Goma will be later," he said, adding fighters would eventually pull back 12 miles from the city.

Ugandan military chief Aronda Nyakayirima said on Tuesday that M23 had agreed to withdraw from Goma unconditionally. But M23's political leader Jean Marie Runiga initially cast doubt on the deal, saying the pull-out was contingent on a list of demands.

The rebels captured Goma last week after Congolese soldiers withdrew and UN peacekeepers gave up defending the city.