Somalia's president has reinstated Prime Minister Omar Abdirashid Ali Sharmarke and his Cabinet, three days after announcing their dismissal.
President Sheikh Sharif Sheikh Ahmed had fired the prime minister after the speaker of parliament said lawmakers had lost confidence in him.
But in a press release Thursday, the president's office said Mr. Sharif reversed that decision after consulting with legal experts and lawmakers who expressed concerns about the way the firing was handled.
Prime Minister Sharmarke had contended the president had no legal right to dismiss him.
The dispute followed a contentious session of parliament Sunday in which some lawmakers claimed they had voted out the speaker, Shiekh Aden Mohamed Nur.
Somalia's transitional government has struggled with internal conflicts as it battles Islamist insurgents who control much of the country.
The government has U.N. backing but controls only a few blocks of the capital, Mogadishu, with the help of African Union peacekeepers.
The AU mission says a Ugandan soldier was killed by a roadside bomb Thursday.
In a separate incident, at least one person was killed when mortar shells hit a home in Mogadishu's Hamarweyne district. The area is near the capital's seaport, where workers were unloading weapons for the AU peacekeeping troops at the time of the attack.
The Horn of Africa country has not had a stable government in nearly 20 years.
Some information for this report was provided by AP, AFP and Reuters.