The presidents of Somalia and Eritrea say they have agreed to establish diplomatic relations after more than a decade of animosity, the latest sign of lightning rapprochement in the restive Horn of Africa region.

Somali President Mohamed Abdullahi arrived in the Eritrean capital of Asmara on Saturday for a three-day visit to hold talks with President Isaias Afwerki. His trip follows an extraordinary rapprochement between ex-foes Eritrea and Ethiopia -- part of changes in a region burdened by war, proxy conflicts, isolation and iron-fist rule.

"The two countries will establish diplomatic relations and exchange ambassadors, promote bilateral trade and investment, as well as educational and cultural exchanges," the two leaders said in a joint statement on Monday.

The decision by the Eritrea's president to invite his Somali counterpart opened a new chapter in ties between the two countries just three weeks after Ethiopia and Eritrea ended two decades of hostility, reopened embassies and resumed flights between their capitals.

The dramatic rapprochement came after Prime Minister Abiy Ahmed took power in Addis Ababa in April and subsequently announced that he wanted to implement a peace deal that ended their 1998-2000 border war.

The Eritrean diplomatic mission resumed its activities in the Ethiopian capital, Addis Ababa, on July 16, during a brief ceremony attended by the Ethiopian prime minister and the Eritrea’s president.

The two leaders jointly raised the Eritrean flag inside the embassy and reaffirmed their commitment to cementing peace between their nations.

Read more:

The history of the three countries and their fallouts has been intertwined.

Eritrea has repeatedly dismissed past Somali administrations' accusation that Asmara was supplying weapons to anti-government militants, saying the allegations were concocted by its enemy Ethiopia.