The presidents of Rwanda and Uganda signed a pact on Wednesday in Angola’s capital aimed at ending a long-running rivalry that has resulted in their busiest border crossing being closed for six months. The signing in Luanda was witnessed by the presidents of Angola and the Democratic Republic of Congo, the Rwandan and Ugandan presidencies both tweeted.

Rwanda and Uganda fought each other in neighbouring Congo in the early 2000s and relations between the two countries and their strongman presidents, Paul Kagame and Yoweri Museveni, have remained tense.

Accusations of supporting respective rebel movements in the other’s country and mistreating each other’s citizens boiled over early in 2019 and Rwanda closed their main border crossing in February. It was briefly re-opened to cargo trucks in June, but then closed again.

Rwandans are still banned from travelling to Uganda, which has accused Rwanda of effectively imposing a trade embargo.

Kagame said, “I deeply thank the leaders of Angola and Congo for their attitude and brotherly commitment to helping us find solutions between Uganda and Rwanda,” according to his office’s Twitter account.