President Bola Tinubu, who is at the helm of regional superpower Nigeria, regards the coup across the border in Niger as a litmus test for democracy in West Africa.
Having assumed the chairmanship of regional bloc Ecowas a mere three weeks ago, he was confronted with a major foreign policy challenge when the military seized power in Niger - a strategic ally in the fight against militant Islamists wreaking havoc across much of West Africa.
Mr Tinubu had raised concerns about the coups in Burkina Faso, Mali and Guinea when he rose to Nigeria's presidency in May, saying Ecowas needed to strengthen its regional force to prevent further coups, and to fight the militants.
So when Niger's President Mohamed Bazoum was overthrown by his presidential guards last week, he responded swiftly by convening a summit of West African leaders at his presidential villa on Sunday.
The regional bloc agreed to impose sanctions on Niger. This has led to electricity blackouts in Niger's capital Niamey and other major cities, as Nigeria has cut off supplies, according to Niger's power company.
Ecowas also gave an ultimatum to Niger's junta - hand back power to the elected president within a week or Ecowas would take "all measures necessary to restore constitutional order".
"Such measures may include the use of force" and military chiefs were to meet "immediately", their statement added.
Though Mr Tinubu's own victory in February's presidential election is being challenged in the courts by opposition candidates who claim the result was rigged, he styles himself as a democrat who took part in the campaign against military rule in Nigeria in the 1980s.