Burkina Faso's army, politicians and civil society leaders have agreed to a one-year political transition with elections in November 2015 following highly charged crisis talks.
The talks on Wednesday, mediated by three West African presidents and also attended by religious and tribal chiefs, failed to name a new leader to head the transitional government.
But a statement after the meeting said all parties had agreed that an "eminent civilian personality" should take the job.
Ghana's President John Dramani Mahama, who mediated alongside his Nigerian counterpart Goodluck Jonathan and Senegal's President Macky Sall, said he was not concerned about the failure to agree on a unity leader at this stage.
"I believe that ... in days rather than weeks, we'll be able to achieve an agreement and install a transitional government," he said.
"Our intention was not to take names back to the ECOWAS summit," he added, referring to an emergency meeting of African leaders due to be held in Accra on Thursday.
"It's a decision for the people of Burkina Faso. They must be the ones to decide. Pain is still fresh in people's mind."
The three presidents had travelled to Ouagadougou to press for the swift return of civilian rule after the military appointed one of its own, Lieutenant-Colonel Isaac Zida, to run the country following last week's ouster of president Blaise Compaore.
Compaore was forced to flee the country to neighbouring Ivory Coast after tens of thousands took to the streets and set parliament ablaze in violent protests against efforts to extend his 27-year rule.
The talks did not start well on Wednesday, with opposition leaders storming out in protest over the possible involvement of Compaore loyalists in any provisional government.
"We haven't even buried our dead yet and they are putting arrogant people back in office who held the people in contempt," said Luc Marius Ibriga, spokesman for the civil society groups, as their representatives left the room.
Security guards had to intervene as emotions ran high.
"We do not want to talk with the old governing party. They represent Blaise Compaore," said Rose-Marie Compaore, parliamentary leader of the main opposition group, the Union for Progress and Change.
Both groups were persuaded to return to the negotiations, only for members of the ruling party to then refuse to sit with them.
The opposition's main leader Zephirin Diabre objected to a proposal by the West African leaders that each group submit three candidates for a transition government. It is a "question of sovereignty," said Diabre.
Tensions were already running high after the military arrested pro-Compaore politician Assimi Kouanda on Tuesday night for calling for demonstrations in support of the deposed ruler.
But the final deal was welcomed by all sides, including the current interim leader, Zida.
"The meeting went very well," he said, adding that he hoped the teams would be able to "find a solution in order to achieve a civilian transition".
There has been mounting international pressure on Zida and the military to return the country to civilian rule, with the African Union threatening sanctions and Canada withdrawing aid.
The UN Security Council called for "a peaceful, civilian-led and democratic transition process leading to the holding of free, fair, inclusive and credible elections as soon as possible".