West African military chiefs met in Ghana on Thursday to discuss a possible armed intervention to reverse a coup in Niger, as Germany called for EU sanctions against the rebel leaders.

Alarmed by a series of military takeovers in the region, the Economic Community of West African States (ECOWAS) has agreed to activate a "standby force to restore constitutional order" in Niger.

ECOWAS is demanding Niger's coup leaders release President Mohamed Bazoum after his July 26 ouster, warning that the bloc could send in troops if negotiations fail.

"Democracy is what we stand for and it's what we encourage," Nigeria's Chief of Defence Staff, General Christopher Gwabin Musa, told the meeting in Accra.

"The focus of our gathering is not simply to react to events, but to proactively chart a course that results in peace and promotes stability," he said.

ECOWAS troops have intervened in other emergencies since 1990, including in wars in Liberia and Sierra Leone. Ivory Coast, Benin and Nigeria are expected to contribute troops, but little detail has emerged over a potential Niger operation.

Abdel-Fatau Musah, an ECOWAS commissioner for political affairs, peace and security, said the Accra meeting would "fine tune" details in case the bloc "were to resort to the ultimate means of force".

The two-day meeting will conclude on Friday when the defence chiefs are expected to announce any next steps.

"The military junta in Niger is playing a cat-and-mouse game with ECOWAS," Musah said. "They have flouted their own constitution and ECOWAS protocols. The military authorities in Niger appear to remain defiant."

The generals who have detained Bazoum blamed deteriorating security in the country for the coup. They have threatened to charge him with treason, but also say they are open to negotiations.

Russia and the United States have urged a diplomatic solution to the crisis.

ECOWAS has already applied trade and financial sanctions while France, Germany and the United States have suspended aid programmes.

On Thursday, Germany's foreign ministry said it wanted the EU to impose sanctions on the coup leaders, adding on social media that Foreign Minister Annalena Baerbock had held talks with her French and US counterparts.

"Germany supports the regional efforts to resolve the crisis in Niger. Our goal is to restore the constitutional order," the ministry said.

- Sahel violence -

The Accra meeting of top army commanders on Thursday and Friday came after fresh violence in Niger, with jihadists killing at least 17 soldiers in an ambush, the defence ministry said.

Twenty other soldiers were wounded, six seriously, in the heaviest losses since the July 26 coup, when the presidential guard ousted Bazoum and detained him and his family.

Jihadist insurgencies have gripped Africa's Sahel region for more than a decade, breaking out in northern Mali in 2012 before spreading to neighbouring Niger and Burkina Faso in 2015.

The unrest across the region has killed thousands of troops, police officers and civilians, and forced millions to flee their homes.

Anger at the bloodshed has also fuelled military coups in Mali and Burkina Faso since 2020, with Niger the latest to fall.

Analysts say any ECOWAS intervention against Niger's coup leaders would be militarily and politically risky, and the bloc has said it prefers a diplomatic outcome.

Talks have taken place this week in Addis Ababa among ECOWAS and Niger representatives under the aegis of the African Union.

The United States said Wednesday that a new ambassador would soon head to Niger to help lead diplomacy aimed at reversing the coup.

- UN food warning -

Bazoum's election in 2021 was a landmark in Niger's history, ushering in its first peaceful transfer of power since independence from France in 1960.

He survived two attempted coups before being toppled in the country's fifth military takeover.

Niger remains one of the poorest countries in the world, regularly ranking at the bottom of the UN's Human Development Index.

The United Nations warned Wednesday that the crisis could significantly worsen food insecurity in the impoverished country, urging humanitarian exemptions to sanctions and border closures to avert catastrophe.

Niger is also facing a jihadist insurgency in its southeast from militants crossing from Nigeria -- the cradle of a campaign initiated by Boko Haram in 2010.