Abdullahi Yusuf, the interim Somali president, has moved to Mogadishu, a day after parliament voted to relocate the government from Baidoa to the capital.
The president immediately left the airport on Tuesday after flying in, the base for 1,200 African Union troops that have just arrived from Uganda, and the target of recent mortar attacks.
Salad Jelle, the deputy defence minister, said on Tuesday: "The president's office will be fully operational in Mogadishu from today and all other ministers and government officials will follow suit.
"Every minister will set up his offices in the capital," he said.
"From what you see on the ground, Ethiopian and Somali troops are at every junction, so the president can safely get to Villa Somalia [the presidential residence]," Jelle said.
The Somali interim government overwhelmingly voted on Monday to relocate from the provincial town of Baidoa to Mogadishu, where fighters have stepped up guerrilla-style attacks in recent weeks, killing dozens of civilians.
But the move is pegged on the government's ability to restore stability there.
So far, attacks have continued, with Mogadishu residents on Monday reporting at least one dead and five injured after a gun battle sparked by an attack on Ethiopian forces.
The incident was the latest in a string of attacks since January when joint Ethiopian-Somali forces ousted the powerful Union of Islamic Courts movement from the country's southern and central regions.
The six-month AU mission aims to deploy about 8,000 troops to enable Ethiopian forces to leave and Somali forces to take over security.