Coup leaders on the West African islands of Sao Tome and Principe released senior government officials late on Sunday, paving the way for an end to the bloodless military takeover.
After almost 10 hours of negotiations with international mediators who jetted into the tiny island nation over the weekend, the junta announced it would free around half a dozen ministers and officials held at army barracks since Wednesday's coup.
"This is an important sign of our credibility in negotiating a solution to the crisis," coup leader Major Fernando Pereira said after the military commission and foreign envoys drove out to the barracks at the end of talks.
Bleary-eyed officials, including Oil Minister Joaquim Rafael Branco, hugged each other at the end of their five-day ordeal and shook hands with the mediators.
Diplomats said the release would set the stage for the return of President Fradique de Menezes, who was in Nigeria when soldiers took over the tiny twin islands in a pre-dawn putsch.
"It's probably just a matter of days now, but these guys are going to want to take it one step at a time and this was a big enough step for the moment," said one foreign official.
Negotiations were due to resume yesterday morning.
The release was part of a five-point agreement signed by the junta and mediators representing eight countries, including regional heavyweight Nigeria and the US who are pushing for a resolution to the crisis in the potentially oil-rich Atlantic state.
A dozen or so ministers were arrested on Wednesday when soldiers took control of one of Africa's smallest states. About six of those were later released.
The volcanic islands off the coast of West Africa have just 170,000 inhabitants.
Under the agreement signed late on Sunday, the officials will remain in their homes under military protection and will not exercise any government functions until the end of negotiations.
"Now we can continue our work in a more serene environment, moving onto the next points on the agenda," said the Congo Republic's Foreign Minister Rodolphe Adada, coordinator of the group of mediators.
Coup plotters have said they wanted a new government formed to end poverty on the islands, which dream of oil wealth from potentially large offshore crude reserves along their maritime border with Nigeria.
Diplomats said a possible compromise would be for de Menezes to dissolve parliament and call elections, creating a new government by constitutional means.
Angolan mediators negotiated an end to a week-long coup in Sao Tome in 1995, persuading the soldiers to return to their barracks after that takeover.