Burkina Faso's military has released the country's interim president after he was detained during a coup that dissolved his government.

The junta released a statement Friday saying that Michel Kafando was freed from military custody. The move comes after international condemnation and demands for his release.

Kafando, a former U.N. ambassador, had been chosen as an interim civilian leader after longtime President Blaise Compaore was ousted in a popular uprising last October.

His government had organized national elections for Oct. 11 but members of the military loyal to Compaore took power and arrested Kafando on Wednesday. The interim prime minister was also detained and remains under house arrest.

The junta later announced that a military general loyal to Compaore is now in charge.