BAMAKO, Mali (AP) — Mali’s transitional president has resigned while he and the prime minister are in detention after being arrested by the military earlier this week.

The resignation comes as representatives of the West African regional bloc are in Mali to mediate the political crisis, officials said Wednesday.

The U.N., the African Union and other international bodies have urged Mali’s military to release the transitional president and prime minister, who were to lead an 18-month civilian transitional government.

Transitional President Bah N’Daw dismissed Prime Minister Moctar Ouane Wednesday before handing in his own resignation letter to former junta leader and transitional Vice President Col. Assimi Goita, according to a military official. A West African diplomat who is involved in mediations also confirmed the resignation and dismissal. Both spoke on condition of anonymity because they were not permitted to speak to the press on the subject.

It was unclear under what conditions the two leaders stepped down.

Goita likely intends to take power himself to control the transition, the diplomat said.

On Tuesday, Goita retook control of Mali, saying he had deposed the president and prime minister on accusations they had formed a new government without consulting him. The two were arrested Monday by the military hours after naming a new Cabinet that did not include two major former junta leaders.

International mediation with Mali's military, led by former Nigerian President Goodluck Jonathan of the West African regional body known as ECOWAS began Tuesday and stretched into Wednesday at the Kati military camp outside the capital, Bamako, where the deposed leaders have been held.

The international community has condemned the detention of the transitional leaders, with French President Emmanuel Macron describing it as a coup and warning of repercussions, including targeted sanctions.

The EU has also warned that it is “ready to consider targeted measures against political and military leaders who obstruct the Malian transition.”