Coup leaders in Mali have agreed to stand down and allow a transition to civilian rule, as part of a deal struck with regional bloc Ecowas.
In return, the bloc will lift trade and economic sanctions and grant amnesty to the ruling junta, mediators said.
The move came after Tuareg rebels in the north declared independence of an area they call Azawad.
The rebels seized the area after a coup two weeks ago plunged the West African nation into political crisis.
Under the terms of transition plan, military rulers will cede power to the parliamentary speaker, Diouncounda Traore, who as interim president will oversee a timetable for elections.
Once sworn in, Mr Traore would have 40 days to organise elections, the five-page agreement says.
The deal, signed by coup leader Captain Amadou Sanogo, states that Ecowas prepare for the ending of sanctions, but did not name a date for Capt Sanogo to hand over power.
"It will be necessary to organise a political transition leading to free, democratic and transparent elections across the whole of the territory," it states.
Officers led by Captain Sanogo seized power on 22 March, accusing the elected government of not doing enough to halt the rebellion in the north.
Earlier, international bodies rejected a call from Tuareg rebels for their newly named region of Azawad to be recognised as independent.
The secular National Movement for the Liberation of Azawad (MNLA) is one of two main groups fighting a rebellion in the north.
Ansar Dine, an Islamist group, has also made gains and has started to impose Sharia law in some towns.
Rights group Amnesty International has warned of a major humanitarian disaster in the wake of the rebellion.
Ecowas is preparing a force of up to 3,000 soldiers which could be deployed to stop the rebel advance.
France's Defence Minister, Gerard Longuet, said France could provide assistance to the force, including transport, Reuters news agency reports.
The Tuareg people inhabit the Sahara Desert in northern Mali, as well as several neighbouring countries and have fought several rebellions over the years.
They complain that they have been ignored by the authorities in the capital, Bamako.