Somalia severed diplomatic relations with neighbouring Kenya on Tuesday, accusing it of meddling in politics as protests and gunfire erupted in the capital Mogadishu over delayed elections.
The dispute could undermine cooperation in the fight against the Islamist group al Shabaab in Somalia, where Kenya provides 3,600 troops to an African Union peacekeeping force.
"Somalia calls back all its diplomats from Kenya and orders Kenyan diplomats to leave Somalia within seven days," Somalia's Information Minister Osman Dube told the state news agency.
Dube added in a statement read on Radio Mogadishu that Nairobi was interfering, but did not give more details.
"This is an answer to the constant political violation and Kenya's open interference in Somalia's independence," he said.
Kenya's government did not immediately respond.
Last month, Somalia expelled Nairobi's ambassador and recalled its own envoy after alleging interference in the electoral process in Jubbaland, which borders Kenya and is one of Somalia's five semi-autonomous states.
Also last year, Kenya recalled its ambassador after Mogadishu decided to auction disputed oil and gas exploration blocks at sea. Ties were restored a few months later.
The new diplomatic flare-up came as anti-government protests broke out in Mogadishu. Demonstrators denounced President Mohamed Abdullahi Mohamed - usually known by his nickname "Farmaajo" (cheese) - over delayed votes for both houses of parliament.
The polls were due early this month but became snagged on disagreements over the composition of the electoral board.
The opposition accuses the government of packing it with sympathisers, which officials deny.
"We do not want a dictator, we do not want Farmaajo," hundreds of protesters chanted, calling for him to quit. Some carried placards with "Farmaajo is a curse" written on them.
Armed men in plain clothes guarded the protesters but soon started exchanging gunfire with police, prompting the protesters to scamper for safety. One witness Halima Farah told Reuters she saw two people injured.
The president was chosen by parliamentarians in 2017, promising to crush al Shabaab, which is fighting to topple the government and rule according to Islamic sharia law. There was no immediate response from the government to the protests.