The East African neighbours have accused each other of espionage and meddling in an escalating standoff.

Rwandan President Paul Kagame and his Ugandan counterpart, Yoweri Museveni, have signed a pact in Angola aimed at ending months of tensions that saw the two neighbours accusing each other of espionage, political killings and attacks on trade.

The two leaders were once close allies but have recently faced off in a series of disputes that many feared could threaten regional stability and economic integration. The enmity led to the closure of an important commercial crossing in February.

According to a statement issued after Wednesday’s signing ceremony in Luanda, the two presidents agreed to respect each other’s sovereignty and that “of the neighbouring countries”.

They also undertook to “refrain from actions conducive to destabilisation or subversion in the territory of the other party (and) acts such as the financing, training and infiltration of destabilising forces”.

The two leaders also agreed to “protect and respect the rights and freedoms” of people “residing or transiting” through their respective countries and to resume cross-border activities “including movement of persons and goods … as soon as possible”.

We have agreed on a raft of issues that will be implemented between our two countries, largely meant to improve our security, trade, and political relations. Uganda is fully committed to enforcing this agreement. pic.twitter.com/Lv3hFIqjnD — Yoweri K Museveni (@KagutaMuseveni) August 21, 2019

After the signing, Museveni said “Uganda is fully committed to enforcing this agreement”, while Kagame noted “it may take a bit of time” for the two countries “to understand each other, but I think we have come a long way”.

For his part, Angolan President Joao Lourenco – who witnessed the signing along with his counterparts from the Republic of the Congo and the Democratic Republic of Congo – hailed the agreement, saying it showed the two presidents’ “willingness to overcome conflict”.

Tensions threaten trade

The bad blood between Rwanda and Uganda had grown in recent months, prompting fears that the row would threaten regional commerce and ensnare neighbouring countries.

Some in Uganda’s intelligence community believe a string of high-profile murders, which included the killing of a police officer and government officials, were carried out by Rwanda, said Al Jazeera’s Malcolm Webb, reporting from Uganda’s capital, Kampala.

Meanwhile, Kigali has continually accused Kampala of supporting rebel groups opposed to Kagame’s government, including the Rwanda National Congress (RNC) and the Democratic Forces for the Liberation of Rwanda (FDLR).

“It’s important to understand that both Museveni and Kagame are military men who came to power by leading armed rebellions and overthrowing their predecessors, and both live in some extent in fear that one day someone will do the same thing to them,” Webb said.

The long-simmering feud snarled regional trade in February, with Rwanda closing its busiest road crossing – known as Katuna to Ugandans and Gatuna to Rwandans – to Ugandan cargo trucks. Rwanda briefly opened the crossing in June before closing it again.

The standoff has escalated several times since, including in March when Rwanda publicly accused Uganda of abducting its citizens and supporting rebels bent on overthrowing the government.

In May, two Rwandan soldiers entered the district of Rukiga in Uganda in pursuit of a suspected smuggler, according to the Ugandan foreign affairs ministry. The soldiers shot dead a Rwandan and a Ugandan, prompting Kampala to accuse Kigali of violating its “territorial integrity” and calling the killings “an incident of murder”.

Rwanda has also banned citizens from travelling to Uganda, which has accused its neighbour of effectively imposing a trade embargo.