* Each side blames the other for continuing fighting
* Envoys seek dissolution of M23, halt to army action
* U.N. official says peace accord is "on the table"
* Congo government says army to "wipe out" rebel positions
African leaders and international envoys appealed to Congo's government and M23 rebels on Monday to stop fighting and embrace a peace deal after the two sides bombarded each other near the Ugandan border.
The appeals were made as United Nations and U.S. envoys said the elements of an accord to end the 20-month insurgency in eastern Democratic Republic of Congo were broadly agreed and only required public commitments to end the hostilities.
A rapid Congolese army advance in recent weeks has driven the M23 rebels from towns and cornered them in the steep, forested hills along the Ugandan border, raising the prospect of peace for Congo's mineral-rich eastern borderlands.
But before leaders from southern Africa and the Great Lakes region that includes Congo met in Pretoria late on Monday to back the peace moves, Congolese authorities accused the rebels of shelling the frontier town of Bunagana and said it showed M23's weekend ceasefire declaration was worthless.
The rebels said they were ready to sign a peace deal but that they had been attacked. Thousands fled into Uganda to escape the fighting but some there were wounded by a shell fired across the border.
"I want to appeal to the leaders of the conflicting parties: give peace a chance," Malawian President Joyce Banda said at the Pretoria summit, after South African host President Jacob Zuma also expressed support for a negotiated settlement.
Ugandan President Yoweri Museveni said the recent fighting had taken him by surprise, given the recent advances made in peace talks between M23 and Congolese government negotiators.
Martin Kobler, the U.N.'s top official in the Congo, said in Pretoria the peace accord between M23 and President Joseph Kabila's government was "practically done and on the table," with broad consensus on the key issues of amnesty for rebels, their reintegration into the army, and their disarmament.
But what was needed was a public announcement of an end to the insurgency from M23. "They have to say 'we are ending the rebellion', not just a ceasefire," Kobler told Reuters.
Echoing this, U.S. Special Envoy to the Great Lakes Russell Feingold added that "of course the next step should be the DRC ceasing its military activities" against M23. Congolese leader Kabila attended the Pretoria meeting.
Bunagana was the last rebel-controlled town to be recaptured last week and rebels are still in the hills nearby. A Reuters reporter said government troops had seized Mbuzi, a strategic hilltop above Bunagana, on Monday after hitting it with tank and rocket fire. Seven rebels were captured, he said.
On Sunday M23 announced a ceasefire - a declaration the Congolese army described as a lie, saying it would pursue the rebels. Congo government spokesman Lambert Mende said four civilians were killed when a shell landed in Bunagana's market.
INTERNATIONAL PRESSURE FOR PEACE
M23 political leader Bertrand Bisimwa complained that the army had attacked its positions with heavy weapons.
"We're only fighting to defend our position. That's the logic of war," he told Reuters.
Bisimwa said the group was ready to sign the peace deal.
"All the items (in the talks) were finished and there's no problem anymore. Why is the government refusing to sign?"
Envoys monitoring the conflict for the United Nations, European Union, African Union and United States jointly urged both sides not to undo progress made in the talks in Uganda.
However, Mende said the army would continue its advance to "wipe out" rebel positions and Congo's government would assess progress at the talks in South Africa before taking any steps at the Ugandan-hosted peace talks.
The rebellion is the worst faced by President Kabila since the end of Congo's last major war a decade ago.
In an embarrassment to Kinshasa and the United Nations, M23 seized Goma, capital of North Kivu province, a year ago after troops fled and U.N. peacekeepers stopped protecting the town.
That prompted changes in Congo's army, a stronger U.N. mandate for a beefed-up peacekeeping force and intense pressure on Rwanda to end its alleged support for the rebels. Rwanda has repeatedly denied backing M23.
Rwandan President Paul Kagame did not attend the Pretoria summit, but sent his foreign minister.
Congo's army has swept through towns across North Kivu in recent weeks though the advance has slowed as rebels have retreated into the hills they used to launch their revolt last year.
Uganda said some shells from Congo had landed on its soil on Monday and border security was being stepped up but it was not clear who had fired them.
A U.N. official in Uganda said thousands of residents were fleeing and 17 had been wounded by shrapnel.
"We were 4 km from the border and the explosions were so bad we had to pull back. The streets are full of people running from the fighting," said the U.N. refugee agency's representative in Uganda, Lucy Beck.