Burkina Faso coup leaders have released the country’s prime minister, Yacouba Isaac Zida, from custody, Al Jazeera has learned, as the army and the elite presidential guard continued surrender talks.

The prime minister was detained alongside the country’s president and an unknown number of cabinet ministers last Wednesday by presidential guard soldiers who then installed General Gilbert Diendere, a close ally of deposed long-term president Blaise Compaore, as leader of the West African country.

The release of Zida, on Tuesday, came hours after army soldiers entered the capital Ouagadougou without resistance after coup leader Diendere said he would hand over power to a civilian transitional government.

Army leaders began surrender talks late on Monday with the elite presidential guard that staged the coup.

“All units [of the army mobilised on Monday to march on the capital] reached Ouagadougou” overnight, Colonel Serge Alain Ouedraogo, deputy head of the Burkinabe police, told the AFP news agency.

“We must now secure the surrender of the [coup leaders] without gunfire or bloodshed,” he said.

At least 10 people have been killed and more than 100 injured in protests sparked by the coup, which came just weeks before what would have been the first elections since Blaise Compaore was ousted in a popular revolt last October after trying to extend his 27-year grip on power.

Diendere on Monday apologised to the nation and said he would hand over control to a civilian transitional government after the military warned that its forces would converge on the capital and forcibly disarm the soldiers behind the power grab.

He said his presidential guard unit “confirms our commitment to giving power back to civilian authorities”, in a communique issued to journalists. That was one of the key conditions of a draft agreement that resulted from weekend negotiations with regional mediators, but it had been unclear until his announcement whether the coup leaders would abide by those terms.

After the announcement, Al Jazeera’s Nicolas Haque, reporting from Ouagadougou, said people were taking to the streets by the military headquarters to celebrate what they hoped meant the end to the coup and the chance of elections later this year.