Guinea on Friday released 16 soldiers and police officers it had detained from Sierra Leone after a dispute over activity near their shared border, Sierra Leonean authorities said. The release came after Sierra Leone officials said a delegation led by Foreign Minister Alhaji Timothy Kabba traveled to Guinea’s capital, Conakry, to discuss the arrest and handover.

Sierra Leone’s Ministry of Information said in a Facebook post that “All security officers arrested by the Guinean authorities have been safely handed over to Sierra Leone.” The ministry said the transfer followed the Conakry visit by Kabba and his delegation, which it described as centered on the situation involving the detained team.

Sierra Leone previously said several members of its security team, including an officer, were apprehended and transported across the border by Guinea’s military. Guinea, for its part, said in a statement that the security team entered Guinean territory without authorization and “set up a tent and raised their national flag” about a mile (1.6 kilometers) inside Guinea’s border.

The latest incident took place Monday in the border town of Kalieyereh in Falaba District, according to Sierra Leone’s government. It said members of its armed forces and police were working on “making bricks for the construction of a border post and accommodation facility” at the site.

The border dispute reflects a larger historical disagreement between the two countries that has persisted for more than two decades, Sierra Leone and Guinea have both pointed to dynamics rooted in Sierra Leone’s civil war from 1991 to 2002. During the war, Sierra Leone invited Guinea to help defend its eastern borders, but Sierra Leonean authorities have said Guinean troops did not fully withdraw afterward.

In previous flare-ups, regional concerns have also been raised about Guinean troop movements in Sierra Leone’s eastern border areas, including a reported entry into a mineral-rich border town last year. The Friday handover of the 16 detained security personnel concluded this week’s confrontation at the point where the two governments described opposing accounts of whether the team was acting within Sierra Leone’s side of the border.