The African Union has approved a plan to send nine battalions of African peacekeeping troops to Somalia to help stabilise the country.
Ethiopian had promised to withdraw its forces in Somalia
A senior AU official said the troops would be deployed for six months, and eventually be taken over by the UN.
They are to take over from Ethiopian forces, who were sent to Somalia last month to drive out Islamist militias.
The AU's peacekeeping plan was announced as fresh gunfire broke out in the Somali capital, Mogadishu.
Unidentified attackers are said to have used mortar fire against the residence of interim President Abdullahi Yusuf.
It is unclear whether he was there at the time. There are no reports of casualties.
The AU's plan to send peacekeepers was announced in the Ethiopian capital Addis Ababa - where the union is based.
8,000-strong force proposed:
Uganda: 1,500 troops offered, subject to parliamentary approval
South Africa: Considering but forces stretched
Its Peace and Security Council approved the deployment of a troops in Somalia for an initial period of six months.
Three battalions are due to be sent initially, with six more battalions to follow over a six-month period.
The AU's commissioner for peace and security, Said Djinnit, said the mission's role would be to "provide support to the transitional federal institutions in their efforts towards the stabilisation of the situation in the country and the furtherance of dialogue".
So far only Uganda has pledged to contribute to the AU force. Other countries are considering possible contributions.
Earlier Ethiopian Prime Minister Meles Zenawi told the BBC his troops would start leaving Somalia "in the next few days".
The Union of Islamic Courts swept over much of southern Somalia last year, capturing Mogadishu in June.
Ethiopia and the United States said the Islamic Courts harboured members of al-Qaeda - something the union has denied.
Ethiopian forces launched a large-scale offensive in December, taking territory captured by the Islamists over the last six months.
Somalia's Ethiopian-backed interim government says some 3,500 Islamist fighters remain in hiding in Mogadishu.