But rivalry and resentment simmered below the surface. In 1998, a dispute over the nondescript border village of Badme escalated into a war that would kill more than 100,000 people. Many Horn of Africa watchers predicted that relations between the two countries would only normalize once the two leaders quit the scene.

Mr. Isaias, 72, is still at the helm, although only last month he was reported to have left Eritrea for emergency medical treatment in Abu Dhabi. Mr. Meles died in 2012. His immediate successor, Halemariam Desalegn, resigned in February, seemingly overwhelmed by the task of running his discontented nation of some 105 million people. Mr. Halemariam’s fresh replacement, Abiy Ahmed — a spruce 41-year-old with a background in military intelligence — is a man in a hurry.

And with good reason. Ethiopia’s capital, Addis Ababa, may be booming, but so is unrest among a young population that scoffs at official 8-to-10 percent annual growth rates, accuses Mr. Meles’s party — which long dominated the ruling coalition — of ethnic chauvinism and corruption, and chafes at government repression. Foreign exchange reserves are running low; the national debt is climbing. Ethiopia has lived through coups and popular revolutions before, and in recent years the Oromo, who make up the country’s biggest ethnic group but have long been marginalized, have been at the forefront of protests. Appointing Mr. Abiy, an Oromo, as prime minister was a smart survival move; the Ethiopian government realized that real change was required.

So have its foreign allies.

In recent years, Western diplomats have grown more and more worried that an increasingly isolated Eritrea, resentful at its treatment by the international community and routinely dubbed a “pariah state” for its domestic human rights record, might come to be seen as an attractive destination by jihadists spilling out of nearby Yemen, Syria and Iraq.

Any such infiltration would be particularly unwelcome given rising geostrategic interest in the Horn of Africa over the last decade and a half. The Red Sea has quietly become one of the world’s most important waterways, with foreign military assets and investment pouring into the region’s ports, railways, airports and roads. Djibouti, landlocked Ethiopia’s de facto outlet to the sea, now hosts troops from the United States and France, but also China, Germany and Japan. The United Arab Emirates’ military operates out of the ports of Assab in Eritrea and Berbera in Somaliland.

For such players, the stalemate between Eritrea and Ethiopia was becoming politically and financially untenable. It is probably no coincidence that Ethiopia’s shift about the boundary this week follows a visit to the region in late April by Donald Yamamoto, the United States’ acting assistant secretary of state for African affairs.