President William Ruto during the opening ceremony of the Ordinary Session of the African Union (AU). [File, Standard]

President William Ruto has warned Niger's junta against further detaining President Mohamed Bazoum and taking over the government, saying the country risks expulsion from the African Union.

Ruto who was speaking in Mozambique during his two-day State visit said that the Niger coup is undemocratic and goes against the rules governing the African Union.

"As the Africa union, we are against the undemocratic removal of any government. Coups are not a solution to the challenges we have as a continent. We are taking a very firm position and advise that any undemocratic removal of any government immediately earns the expulsion from the African Union," said Ruto.

According to the Kenyan Head of State, AU will support any decision made by ECOWAS to ensure that President Bazoum is reinstated.

"Our position is that President Bazoum should be reinstated as the democratically elected president of Niger. We need to put a stop to the slide to undemocratic governments in our continent."

His sentiments come weeks after a military junta in Niger led by army General Abdourahmane Tchiani took over power holding their democratically-elected president hostage.

This has attracted the attention of leaders globally who have strongly condemned the coup.

AU Chairperson Moussa Faki in a communique on Friday, August 11 condemned the detention of President Bazoum, terming it a "worrying situation."

"Such treatment of a democratically elected president through a regular electoral process is unacceptable," noted Faki.

AU has further called for the immediate release of President Bazoum and all members of his family and government who are illegally detained with him.

"Their detention flies in the face of Nigerien law and the founding principles of the AU and ECOWAS," read part of the communique.

Nigerian on Wednesday, August 2 cut electricity supply to Niger to destabilize the coup.

Other actors including the United Nations (UN), ECOWAS, and US Vice President Kamala Harris have also largely condemned any efforts to seize power by force in Niger.

Currently, ECOWAS through the support of other International groups has intervened to see that Bazoum is reinstated.