"Heavy shelling was hitting civilian populated areas, including Bakara market, Holwadag and Hodan."
Clashes are said to have broken out after opposition fighters fired mortar bombs at the president's plane, triggering a response from African Union peacekeepers.
Sharif, who was heading to Uganda for an African Union summit, was not hurt in the fighting, sources told news agencies.
Fighting in Somalia has killed 19,000 civilians since the start of 2007 and driven another 1.5 million from their homes.
But both sides of the conflict have been accused of indiscriminate shelling of civilian areas.
Al-Shabab, a powerful group of fighters with suspected links to al-Qaeda, and a political group called Hezb al-Islam are fighting to overthrow the fragile UN-backed government.
The groups control much of southern and central Somalia, and want to impose their version of sharia (Islamic law) in the country.
Somalia has seen more than 15 transitional governments come and go since civil war broke out in 1992.