NAIROBI (Reuters) - Five hundred years ago, an Imam who ruled much of what is now Somalia, led a daring invasion of Christian Ethiopia, looting monasteries, burning down churches and slaying all who resisted.
Centuries on, memories of Imam Ahmad Gragn still haunt both countries, and echoes of that long and bloody history still ripple across the Horn of Africa region which considers Somalia the greatest threat to its stability.
Back then, the Ethiopians were beleaguered as the invaders occupied some two-thirds of the country. Help eventually came in the form of 400 Portuguese musketeers, who sailed into Massawa port and embarked on a six-day march to the front.
Gragn had his backers too. Reinforcements from Arabia soon rolled in alongside a gift from the Ottoman Empire: 900 of its famously hardened musket experts. The war lasted over a decade.
Fast forward to the present day, and with Ethiopian troops deploying over the border again last month to fight Islamist rebels linked to al Qaeda, the latest chapter of a book with few uplifting passages was written.
Though present-day incursions and clashes are driven by strategic motivations and regional politicking against the backdrop of the global war on terror, those centuries-old grudges, raids and musket-battles still shape events.
"In Ethiopia, the damage which Gragn did has never been forgotten," Ethiopia expert, Paul Henze, wrote in a book on the country's history, Layers of Time.
"Every Christian highlander still hears tales of Gragn in his childhood. I have often had villagers in northern Ethiopia point out sites of towns, forts, churches and monasteries destroyed by Gragn as if these catastrophes had occurred only yesterday."
Though Gragn's ethnicity is disputed by historians, Ethiopians know his army was overwhelmingly manned by ethnic Somalis, and that stings.
DELICATE RELATIONS, COMPLEX HISTORY
Somalis, too, are haunted by past Ethiopian invasions.
Ethiopia and Somalia still hand-pick powerful allies keen to win clout in the Horn of Africa.
Its location on the Gulf of Aden and its potential as a base for militant Islam make it an ideal arena for proxy wars, influence-peddling and diplomatic skullduggery.
The two countries - Ethiopia then supported by the Soviet Union and Cuba and Somalia supported by the United States - fought one of their many wars over Ethiopia's mainly ethnic-Somali Ogaden region in 1977-1978.
Ethiopia's victory was helped by some crack Cuban troops, a modern day echo of the foreigners who helped in the sixteenth century. Since then, Western and Eastern powers have switched allegiances, depending on the politics of those in power.
These days, Ethiopia, seen as a critical bulwark against the rise of Islamist militancy in the strategic region next to the world's busiest shipping lanes, is Washington's main ally.
"An unstable Horn of Africa could have a destabilizing effect on the world," a Western diplomat in the region told Reuters. "The U.S., Britain, China - and increasingly Turkey -are all trying to get a foothold here for both security reasons and economic reasons. Ethiopia makes the best ally right now."
But despite the leadership changes, and the temporary alliances in a region that is no stranger to pragmatic politics, that old animosity is playing out again.
ETHIOPIA. WHO ELSE?