BAMAKO, May 26 (Reuters) - International pressure increased on Mali's military leaders to free the president and prime minister on Tuesday, a day after their arrest deepened a political crisis and threatened to derail a transition to democratic elections.

President Bah Ndaw and Prime Minister Moctar Ouane have been detained at a military base outside the capital Bamako since Monday evening. French President Emmanuel Macron condemned what he said was a "coup within a coup" and raised the threat of targeted sanctions. read more

The two men were in charge of a transitional government created after a military takeover in August that ousted President Ibrahim Boubacar Keita. They were tasked with overseeing a return to democratic elections next year.

The U.N. Security Council is due to privately discuss the latest developments in Mali on Wednesday, diplomats said.

Interim vice president Colonel Assimi Goita said on Tuesday he had seized power because the president and prime minister had failed to consult him about a government reshuffle in which two former coup leaders lost their cabinet positions. Goita orchestrated the August coup before being appointed vice president of a civilian-military transition.

France, a former colonial power and military ally to Mali, joined the United States, the European Union and others in condemning the detention and called for their immediate release.

"We are prepared to take in the coming hours targeted sanctions against those taking part," Macron told reporters at the end of an EU summit.

The situation could exacerbate instability in the West African country, where Islamist groups linked to al Qaeda and Islamic State control large areas of the north and centre and stage frequent attacks on the army and civilians.

Political instability and military infighting have complicated efforts by Western powers and neighbouring countries to help Mali, and jihadists have been able to use the country as a launchpad for attacks across the region.

In a statement read by an aide on national television, Goita said elections next year to restore an elected government would go ahead as planned.

"The vice president of the transition saw himself obligated to act to preserve the transitional charter and defend the republic," the statement said.

Mali has been in turmoil since 2012 when the army, frustrated over the government's handling of a rebellion, ousted president Amadou Toumani Toure. Separatist and Islamist rebels took advantage and seized the north of the country.

French forces drove back the Islamists in 2013 but they have regrouped and expanded their reach to neighbouring Burkina Faso and Niger.

Worried about the fallout from Monday's detentions, the United Nations, European Union, United States and regional countries have all demanded the release of the leaders.

"Sanctions will be adopted against those who stand in the way of the transition," Josep Borrell, the EU's foreign affairs chief, said on Twitter.

A delegation from the Economic Community of West African States (ECOWAS) arrived in Mali on Monday to help resolve the dispute. ECOWAS played a key role in the formation of the interim government after the August coup.

The problems in Mali are part of a recent democratic backslide in West and Central Africa, where strong military factions have taken control or presidents have extended their rule beyond their allotted mandates.

Last month a military council seized power in Chad after the battlefield death of president Idriss Deby. His son, Mahamat Idriss Deby, now runs the country and has promised a transition to civilian rule similar to Mali's. The opposition and civil society say the military holds too much power and fear Deby will not relinquish control.