However, the Al-Shabab group that controls much of southern Somalia has not signed up to the deal.
Ahmed, along with other top leaders, left Somalia in late 2006 after the UIC, which had ruled much of southern and central Somalia, was routed by allied Somali government and Ethiopian forces.
Somalia's new parliament is scheduled to elect leadership for the Horn of Africa nation early next year.
The fighting in Mogadishu came on the same day representatives from 40 countries met in Nairobi, Kenya to try solve the piracy problem off Somalia's coast.
Ahmedou Ould-Abdallah, the UN's special representative for Somalia, said the world has ignored the issue for long.
Somali pirates have seized several large vessels in recent months, including a tanker carrying millions of gallons of crude oil and a Ukrainian freighter loaded with tanks and other military hardware.
An estimated $30m in ransom have been extorted by the pirates this year.
The US sought international authorisation on Wednesday to hunt pirates on land with the co-operation of Somalia's weak government.
The last time the US military entered Somalia in 1992-1993 culminated in deadly clashes in Mogadishu that forced the withdrawal of American forces from the country.