Somalia President Mohamed Abdullahi Farmajo began an historic three-day visit to Eritrea on Saturday, where he holds talks with his counterpart in Asmara.
Eritrea's information minister announced on Friday that Somalia's leader was invited by Eritrean President Isaias Afwerki.
"Somalia is ready to write a new chapter of its relations with Eritrea," Somalia's presidential spokesman Abdinur Mohamed said Saturday on Twitter.
The countries have not had any diplomatic ties for nearly 15 years, but the spokesman said the visit "will open the doors for diplomatic relations and new cooperation between the two nations."
Somali and Eritrean flags were placed along the streets of the Eritrean capital, Asmara, ahead of the visit.
The visit by Farmajo comes after the long-time rivals Eritrea and Ethiopia restored diplomatic ties, a move that ended the regional and international isolation of Eritrea that lasted for nearly two decades.
For years, the tensions between Eritrea and Ethiopia had played out partly in Somalia as each gave military support to opposing sides in Somalia.
In 2007, Eritrea had supported the Islamic Courts Union ICU, which ruled much of southern and central Somalia for six months before being ousted in a 2006 Ethiopian-led military offensive.
In 2009, the United Nations Security Council imposed sanctions on Eritrea for its role in Somalia.
Eritrea was accused of supporting Somalia's al-Shabab group, a charge it had denied. Those sanctions could soon be lifted after Ethiopia's prime minister recently asked the U.N. to remove the sanctions on Eritrea.