What you need to know:
- The ambush took place near the small settlement of Buffow, close to the port of Merka
- President Mohamud usually travels in an armoured convoy under the protection of the African Union force
Somalia's Al-Qaeda linked Al Shabaab insurgents ambushed President Hassan Sheikh Mohamud Tuesday, the militants said, claiming to have destroyed vehicles with rocket-propelled grenades.
"We ambushed a convoy that was escorting the self-appointed Somali president," Al Shabaab spokesman Abdulaziz Abu Musab told AFP.
President Mohamud escaped unhurt.
"Gunmen tried to disrupt the president's trip ... but I can confirm the president and his delegation are well and reached their final destination Merka to have meetings with local community," said Somali army official Mohamed Qorey, speaking by telephone from Merka.
The ambush took place near the small settlement of Buffow, close to the port of Merka, a former Al Shabaab stronghold captured one year ago around 100 kilometres (60 miles) south of the capital.
"We were tracking his (Mohamud's) movements...the fighting is still going on," Musab said.
There were no immediate reports of any casualties or confirmation from Somalia's government.
Outside the capital Mogadishu, Mohamud usually travels in an armoured convoy under the protection of the 17,700-strong African Union force that fights alongside the Somali army.
Al Shabaab fighters in May 2012 ambushed the convoy of Mohamud's predecessor, Sheikh Sharif Sheikh Ahmed, but the president escaped unharmed.
Somalia's weak central government, selected in a UN-backed process in August 2012, has made steps forward in Mogadishu but has little influence outside the capital.
The new government was the first to be given global recognition since the collapse of Somalia's hardline regime in 1991.
But the authorities have been dealt a number of setbacks in recent months, including a string of Al Shabaab attacks, accusations of rape against the army and AU soldiers and a pull-out by aid workers because of a wave of kidnappings and killings.