ADDIS ABABA, Ethiopia — Ethio­pian Prime Minister Abiy Ahmed traveled Sunday to Eritrea, once a bitter adversary, and agreed to normalize ties after an unprecedented summit.

The rapprochement between the two neighbors could have far-reaching consequences for improving the stability of the Horn of Africa, which is home to several conflicts and environmental crises.

The two nations, sworn enemies for two decades, fought a brutal war from 1998 to 2000 in which at least 70,000 people were killed. In the intervening years, the two sides have clashed repeatedly and supported rival rebel movements.

Abiy was hugged by Eritrean President Isaias Afwerki at the airport in Asmara, the Eritrean capital, and they smiled and laughed as they strode past a uniformed band and honor guard.

The friendly welcome set the tone for the visit; the two men were shown several times on Eritrean state television smiling together before announcing at an evening banquet that relations will be normalized.

The two countries will reopen embassies, restore flight links and allow direct telephone calls. Landlocked Ethi­o­pia will look to start using Eritrea’s Red Sea ports.

“We have agreed to open up embassies in our respective countries, allow our people to visit each other’s cities, and allow our airlines and ports to operate freely,” Abiy said. “Love is greater than modern weapons like tanks and missiles. Love can win hearts, and we have seen a great deal of it today here in Asmara.”

Abiy, who came to power in April and has already turned Ethiopia’s stagnant political scene on its head, has frequently preached about love and unity in his speeches in Ethi­o­pia.

The convoy of vehicles that carried him from the airport through downtown Asmara was swamped by loudly cheering crowds that spilled onto the road and slowed the cars to a crawl.

“Peace is everything; it is health, development, education,” an elderly man wearing a turban and sunglasses told Eritrean state television the morning of the visit. “Everyone in the world loves peace.”

“The Eritrean people have today got the chance to express their true love and emotion for Ethiopians,” Isaias said at the evening banquet, according to news agencies. “We can imagine that the decision the prime minister of Ethiopia took was not a simple one. But we can assure you we will face the future together. We will work as one.”

The change in relations has stunned observers.

Hallelujah Lulie, a political analyst specializing in the Horn of Africa, said the two countries had come to the realization that the status quo — no war, no peace — could not continue. As Eritrea’s relations with the West and Arab countries improved, it also became more open to rapprochement. In Ethi­o­pia, the accession of Abiy, who represented a break from the party that conducted the war with Eritrea, also made it easier to find an end to the stalemate.

Hallelujah added that mediation over the past month by Saudi Arabia and the United Arab Emirates, which have increasingly close ties to Eritrea, probably helped create the breakthrough.

“It will radically redraw the geopolitical map of the Horn of Africa and East Africa,” he said. “The rivalry between Ethi­o­pia and Eritrea was reflected in conflicts in South Sudan, Somalia, even sometimes up to Chad.”

Nearly 30 years ago, when Eritrea was a province of Ethi­o­pia, the future leaders of the two countries were comrades in the struggle against Ethiopia’s communist dictatorship. But after the overthrow of the dictatorship and Eritrea’s declaration of independence, relations soured despite close cultural and linguistic ties.

Abiy broke the deadlock between the two countries June 5 by accepting the 2000 peace agreement that ended the war, which would involve ceding territory still held by Ethi­o­pia.

Events moved quickly after that, with Isaias accepting Abiy’s overtures as a “positive” move and sending a delegation led by his foreign minister to Addis Ababa, Ethiopia’s capital, a week later.

The normalization of ties notwithstanding, the complex process of returning disputed territory and figuring out what happens to the people living there lies ahead.

Under Abiy, Ethi­o­pia appears to be embarking on a path of reform, but Eritrea has been characterized as one of the most authoritarian and closed states in Africa.

For much of the past 20 years, Eritrea has been focused on its conflict with Ethi­o­pia, with substantial spending on its military and indefinite mandatory military service that has led hundreds of thousands of Eritreans to try to immigrate to Europe.

The end of the conflict could open the way not only for the end of mandatory conscription in Eritrea but also a return to democratic provisions in the constitution that were suspended, including elections.

“There won’t be radical change, but some reforms could be on the horizon,” Hallelujah said.