Ibrahim Boubacar Keita, the President of Mali announced his resignation on state television in the early hours of Wednesday morning, AFP reported. The rebel soldiers had launched a coup in Mali on Tuesday.

The President also dissolved the government and the national assembly. “I would like at this precise moment, while thanking the Malian people for their support throughout these long years and the warmth of their affection, to tell you of my decision to relinquish my duties,” Keita said. He said  he was resigning to avoid “bloodshed.”

In a dramatic turn of events, the troops which seized Keita’s office had detained both President and Prime Minister Boubou Cisse. They were driven in armoured vehicles to an army base in the town of Kati, about 15 kilometres (nine miles) away.

ALSO READ | 19 civilians dead, 2 wounded in a massacre at DR Congo

Mali had been witnessing a public unrest since May this year after the country’s top constitutional court had revoked results from a disputed parliamentary elections, paving the way for Keita’s party to occupy a majority of the vacant seats.

Meanwhile, UN Secretary-General Antonio Guterres demanded the “immediate and unconditional release” of Keita and Cisse as diplomats in New York said the Security Council would hold emergency talks on Wednesday.

ALSO READ | Six French tourists among eight killed by gunmen in Niger

Mali is infamous for its unstable governments. The country had earlier faced a major revolt in 2012 after a coup staged by army officers opened an opportunity for Jihadi groups and rebels from the country’s long marginalized Tuareg to seize a significant part of the country.