Trouble has horns to hold but not tails.

This Somali proverb, suggesting that disaster can be prevented but not easily controlled, feels very apt for East Africa right now. Trouble has certainly arrived. Thanks to Prime Minister Abiy Ahmed of Ethiopia’s expansionist ambitions and reckless designs, the Horn of Africa is on the cusp of a war that would imperil the region and rebound against the rest of the world. It must be stopped before it’s too late.

The catalyst for the conflict is Mr. Abiy’s obsession with making Ethiopia a coastal state. Last year, he declared that Ethiopia could not stay landlocked and must have access to the sea, either by negotiation or by force. Somalia, the weakest of the five coastal countries that border Ethiopia, was the obvious target. On Jan. 1, Mr. Abiy duly signed a memorandum of understanding with the president of Somaliland, a self-declared breakaway republic in northwestern Somalia. In exchange for officially recognizing Somaliland, Ethiopia would gain a 12-mile naval base on the Gulf of Aden. Mr. Abiy would have his coast.

This was a clear violation of Somalia’s sovereignty and territorial integrity, recalling Ethiopia’s destructive history of meddling in the country. Somalia immediately rejected the memorandum and mounted a diplomatic offensive, explaining to regional states and international powers that Ethiopia was seeking control of Somali territory through illegal means. The United Nations, the African Union, the United States and the European Union all backed Somalia’s position, emphasizing the necessity of respecting established boundaries and national sovereignty.

Yet despite international pressure, particularly from the Biden administration, Mr. Abiy has remained resolute. He seems to believe that now is the right moment to carry out his plan, as Somalia grapples with an extremist insurgency and the American government is distracted by elections and embroiled in conflicts in the Middle East and Europe. A possible victory for Donald Trump, who Mr. Abiy apparently hopes will either support or be indifferent to his actions, is another boon.

Tensions, bubbling away all year, have escalated in recent weeks. In a display of power, Ethiopia sent its troops to Somalia twice in June, setting off complaints from Somalia to the United Nations Security Council. In July, a local militia in Somalia looted two truckloads of weapons and ammunition sent from Ethiopia, suggesting that arms have made their way into the country, too.

Somalia, for its part, threatened to expel Ethiopian troops from the African peacekeeping forces in the country and, in a bold move, approved a defense pact with Egypt in July — adding to one it signed earlier in the year with Turkey. Ankara has stepped in to mediate but has been unable to find a solution. With both sides at loggerheads, the region is sitting on a time bomb.