(CNN) -- Somalia's president escaped an opportunistic attack by Islamic militants Wednesday as deadly fighting erupted in the center of Mogadishu, officials said.
Sheikh Sharif Sheikh Ahmed was returning from a trip to Yemen when insurgents began firing mortars, resulted in a clash with African Union peacekeepers, the president's director of communications told CNN.
"The Islamic insurgents were just guessing the arrival of the president so they started firing mortars, just to send a kind of their regular violent message that they are around," said Abdulkadir Barnamij.
The heaviest of the fighting was centered on Maka Al Mukarama, which links the airport to the presidential palace but it is heavily guarded by forces from the African Union Mission in Somalia.
Meanwhile Ali Muse, head of an emergency group in the city, confirmed to CNN that three people died and 16 others were wounded in the fighting.
"The casualty (number) is small because people deserted the streets soon after the fighting started," said Ali Muse.
-- Journalist Mohamed Amiin Adow contributed to this report