Somali leaders set transition deadline
Leaders of disparate Somali factions have agreed to a timetable that will elect a new president by 20 August.
The historic deal came after three days of heated discussion in Ethiopia, attended by the six signatories.
But hardline al-Shabab Islamists, who control much of central Somalia, were not party to the agreement.
Donors had threatened to withdraw funding if proposals to end the country's two-decade political crisis were not agreed.
The BBC's Mary Harper in the Ethiopian capital, Addis Ababa, says the election of the new president will mark the end of a long transition process.
She says the signatories all said in public that they were committed to the deadlines and seemed relieved there had been agreement at last after years of squabbling.
The leaders also agreed on a draft constitution and that a new federal parliament, to be selected by a group of elders, will be sworn in by 20 July.
The 225 MPs - half the number in the current parliament - will elect the president.
The signatories included the current interim President Sheikh Sharif Sheikh Ahmed, his prime minister and the parliamentary speaker, as well as the regional leaders of Galmudug, Puntland and a representative of the pro-government militia al-Sunna Wal Jama'a.
Puntland's President Abdirahman Farole told the BBC he was "quite confident" that the timetable would be met, but admitted that traditional elders sometimes let deadlines slip as they "prefer to all the time reach decisions by consensus".
The self-declared independent state of Somaliland, which broke away when the civil war started in 1991, has refused to take part in the deal which will see Somalia become a federal state.
The interim government has been backed by the United Nations and is trying to secure the country with the help of an African Union force.
Al-Shabab, which merged with al-Qaeda this year, is now under pressure on a number of military fronts.
A Somali army commander has told the BBC's Somali Service that his troops, backed by AU soldiers and tanks, are within several kilometres of Afgoye town, an al-Shabab stronghold some 30km (18 miles) from the capital, Mogadishu.
The town of Afgoye lies on a strategic crossroads for routes to the north, west and south of Somalia.
Earlier this year the UN agreed to boost the AU force from 12,000 troops to nearly 18,000 to incorporate Kenyan troops which entered Somalia last October in pursuit of al-Shabab militants.
They accuse the fighters of being behind various kidnappings on Kenyan soil and of destabilising the border region.