Mali President Ibrahim Boubacar Keita resigned on Tuesday and dissolved parliament hours after mutinying soldiers detained him at gunpoint, plunging a country already facing an insurgency and mass protests deeper into crisis.

Keita resigned in a brief address broadcast on state television after troops seized him along with Prime Minister Boubou Cisse and other top officials.

“Today, certain parts of the military have decided that intervention was necessary. Do I really have a choice? Because I do not wish blood to be shed,” he said from a military base in Kati outside the capital Bamako where he had been detained earlier in the day.

The development came hours after soldiers took up arms and staged a mutiny at a key base in Kati, a town close to Bamako.

The soldiers were expected to deliver a statement later, while countries in West Africa, along with former colonial power France, the European Union and the African Union, denounced the actions of the soldiers and warned against any unconstitutional change of power.

The Economic Community of West African States (ECOWAS) has condemned the coup attempt in Mali and has moved to suspend the country from its decision-making body, according to Al Jazeera’s Ahmed Idris, who is reporting from Abuja in Nigeria.

In an announcement, the regional alliance also said that neighbouring countries of the West African state are closing its borders and will impose sanctions as the crisis continues.