Somalia's parliament has given Prime Minister Nur Hassan Hussein a strong vote of confidence, a day after the president said he was firing him.
In a special session Monday, lawmakers voted 143 to 20 with seven abstentions to keep Mr. Hussein in office.
There was no immediate reaction from President Abdullahi Yusuf, who told VOA Somali service on Sunday that he would abide by parliament's decision.
Earlier Sunday, the president accused Mr. Hussein and his ministers of corruption, inefficiency, and treason.
The power struggle raises new questions about the future of the Somali government as it struggles with a rising Islamist insurgency.
In a statement, African Union Commission Chairman Jean Ping says the dispute could undermine efforts to stabilize Somalia and establish peace.
The government recently reached a peace deal with a moderate Islamist group, the Alliance for the Re-Liberation of Somalia. But hardline Islamists rejected the deal and have continued taking over towns in the country's center and south.
On Sunday, a spokesman for the leading insurgent group al-Shabab told reporters his group wants to impose Islamic law in Somalia, and will never accept a power-sharing deal.
Fighting over the last two years, involving Ethiopian-backed government forces and a variety of Islamist groups, has killed thousands of Somalis and displaced at least a million others.
Ethiopia has said it will pull its troops within a few weeks.
Some information for this report was provided by AFP and AP.