Hundreds of people turned out to see the new president
Somalia's new president, Sheikh Sharif Sheikh Ahmed, has arrived in Mogadishu for the first time since his election by MPs a week ago.
Crowds lined the route as Sheikh Sharif, viewed as a moderate Islamist, headed to the presidential palace.
Later, mortars were fired at the palace but no casualties were reported.
Sheikh Sharif aims to form an inclusive government and extend a hand to armed groups still opposed to UN-sponsored efforts to end civil war and turmoil.
Somalia has had no effective central government for nearly 20 years.
Tens of thousands of people have been killed in successive waves of violence over the years.
Sheikh Sharif, 44, was elected president on 31 January at a meeting of Somali MPs held in neighbouring Djibouti, replacing President Abdullahi Yusuf who resigned a month earlier after a power struggle.
He was appointed as part of a UN-brokered plan to try to form a unity government and bring peace to Somalia for the first time since 1991.
The new president arrived back in Somalia from Ethiopia, where he attended an African Union summit.
The former teacher used to lead an armed opposition movement ousted by Ethiopian-led forces in late 2006.
"My trip to Mogadishu is aimed at having consultations with elders, politicians and Islamic resistance groups," he said as he arrived in Mogadishu accompanied by MPs.
He appealed in Addis Ababa for foreign military help to deal with "extremists" against the peace process.
The Islamist al-Shabab militia - which last week seized Baidoa, the seat of the Somali parliament - has been holding protests against the new president.