Ethiopian and Eritrean leaders have formally restored relations between the two countries, ending 20 years of enmity and prompting phone calls across the border by people getting back in touch with friends and family.

The Ethiopian prime minister, Abiy Ahmed, and the Eritrean president, Isaias Afwerki, also signed agreements to open embassies, restore flight services and for Ethiopia to use port facilities in Eritrea. The signing took place in Eritrea’s capital, Asmara, before Abiy flew back to Ethiopia.

“The march toward peace might have been a long time coming but we have faith in the love and solidarity of our people,” said Abiy at the signing. “We can now imagine a future where we see no national boundaries or high walls dividing us. The people of our region are joined in common purpose.”

Residents wasted no time in phoning each other after a block on telecommunications between the two countries was lifted. “Received the first call from Asmara in Eritrea!” said Ermiyas Teklu in Ethiopia after speaking to his uncle and his family. “The last time I talked to them was when I was in a third country. My mother is going to talk to our relatives in Eritrea and everyone is excited about it.”

A video grab shows Abiy Ahmed and Isaias Afwerki embracing in Asmara, Eritrea. Photograph: AP

Many Ethiopians expressed their exhilaration on social media and changed their profile pictures to a photo taken on Sunday of the Ethiopian and Eritrean leaders embracing.

“The events of these past two days between Ethiopia and Eritrea are like the fall of the Berlin Wall. Only amplified 1,000 times,” Samson Haileyesus wrote on Facebook.

Abiy’s chief of staff, Fitsum Arega, tweeted: “A state of war between the two countries has come to an end.”

Ethiopia’s foreign minister, Workneh Gebeyehu, said flights between the countries would resume next week.

The UN secretary-general, António Guterres, who is visiting Ethiopia, said the resumption of relations between the two countries was “illustrative of a new wind of hope blowing across Africa”.