Somalia’s President Mohamed Abdullah Farmajo has suspended the prime minister, who is facing allegations of involvement in the theft of land.
Mohamed Hussein Roble accused the president of trying to stage a coup, and said he would continue in office.
He urged the security forces to take orders from him rather than Farmajo.
Troops loyal to the president earlier failed to block Roble from entering his office in the capital Mogadishu, said the prime minister’s allies. The two leaders have been involved in a long-running power struggling, raising fears of further instability in Somalia.
The US embassy in Somalia urged the leaders “to refrain from provocative actions, and avoid violence”.
Somalia has not had an effective central government since the overthrow of long-serving ruler Siad Barre in 1991.
The country is marred by disputes between rival politicians and clans. It is also battling an insurgency by al-Shabab, an affiliate of al-Qaeda.
Farmajo’s term officially ended in February but was extended because of disagreements over how to choose a new president.
A complex election for parliament, which involves clan elders choosing MPs, has been under way since November. It was supposed to have concluded by December 24 but the deadline was missed.
The two leaders have accused each other of undermining the elections.