US President Donald Trump took part in the signing ceremony of a peace deal with the President of Rwanda Paul Kagame and the President of the Democratic Republic of the Congo Felix Tshisekedi / AFP

US President Donald Trump and the leaders of Rwanda and the Democratic Republic of Congo signed a peace deal Thursday, even as fresh violence raised questions about the accord to end one of Africa's longest wars.

Trump said the United States was also signing deals on critical minerals with the two countries as he hosted Paul Kagame, the longtime president of Rwanda, and Congolese President Felix Tshisekedi in Washington.

"I think it's going to be a great miracle," Trump said after the signing -- held in a peace institute which his administration has just renamed after him.

Speaking of the two leaders, he added: "They spent a lot of time killing each other, and now they are going to spend a lot of time hugging, holding hands and taking advantage of the United States of America economically, like every other country does."

But the African leaders both took a more cautious tone, as fighting raged in eastern DRC where the M23 armed group -- which the UN says is backed by Rwanda -- has been gaining ground in recent weeks against Kinshasa's forces.

"There will be ups and downs on the road ahead, there is no doubt about it," said Kagame, whose allies have taken a decisive edge on the ground against his country's turbulent neighbor.

The DRC's Tshisekedi called it the "beginning of a new path, a demanding path."

- 'A lot of money' -

Trump has boasted that the eastern DRC conflict, where hundreds of thousands of people have died over several decades, is among eight wars he has ended since he returned to office in January.

The US president has made no secret of his desire to win the Nobel Peace Prize.

Trump said the agreement will pave the way for the United States to gain access to critical minerals in both countries. The violence-torn eastern DRC in particular has reserves of many of the key ingredients in modern technologies such as electric cars.

It is the latest in a series of deals in which the billionaire Republican has negotiated a stake for US firms to extract rare earth minerals, including in Ukraine.

"We're going take out some of the rare earth," Trump said. "And everybody's going to make a lot of money."

The signing comes more than five months after the countries' foreign ministers also met Trump and announced another deal to end the conflict.

The long-simmering conflict exploded in late January as the M23 captured the major cities of Goma and Bukavu.

After the June agreement, the M23 -- which denies links to Rwanda -- and the Kinshasa government pledged a ceasefire following mediation by US partner Qatar, but both sides have since accused the other of violations.

- 'Many dead' -

Violence continued on the ground even on the day of the signing.

An AFP journalist at the scene heard weapon fire ring out on the outskirts of Kamanyola, an M23-controlled town in South Kivu province near the borders with Rwanda and Burundi. 

"Many houses have been bombed, and there are many dead," said Rene Chubaka Kalembire, an administrative official in Kaziba, a town also under M23 control, on the eve of the signing.

After several days of clashes around Kaziba, fighter jets bombarded the town again on Thursday morning, a local civil society representative who requested anonymity told AFP.

Explosions could also be heard coming from the Bugarama border post in Rwanda across the border in neighboring Burundi, with Rwandan police temporarily shutting the frontier post on Thursday. 

AFP was unable to obtain a verifiable toll from the fighting from independent sources.

Local sources reported a massive build-up of M23 reinforcements, accompanied by armored cars, in the high plateau of South Kivu.

Passage through the mountainous region would allow its troops to encircle Uvira, the last major town in South Kivu to evade the M23's capture.

The Trump-brokered deal meanwhile comes as both countries are in talks with his administration on its priority of taking in migrants amid the president's sweeping deportation drive.

burs-dk/des