Somalia's prime minister suspended the intelligence chief on Monday, prompting a public rebuke from the president and highlighting growing divisions at the heart of the political elite.
Analysts said the suspension - triggered by a dispute over investigations into an unsolved murder - pointed to a deeper power struggle that could further destabilize a country already riven by militant attacks and clan rivalries.
Prime Minister Mohammed Hussein Roble said he had told Fahad Yasin, the director of Somalia's National Intelligence Service Agency (NISA), to step aside for failing to deliver a report on the murder of one of the agency's agents.
Soon after, President Mohamed Abdullahi Mohamed issued his own statement calling the prime minister's move unconstitutional. "(Yasin) should continue being the director of NISA," the president said.
Somalia's police chief called an emergency security meeting on Monday, officers told Reuters on condition of anonymity without going into further details.
"This shows the rift between the president and the prime minister is fully in the open - something that had been bubbling beneath the surface for some time," Mahmood Omar, Somalia analyst at the International Crisis Group, told Reuters.
"It could result in another security crisis as the president is telling Roble there are some clear red lines to what he will accept, while Roble interprets his authority differently. The danger is either side, ... will try to impose their will on the other."
The immediate cause for the dispute - the murder of the young female agent, Ikran Tahlil Farah, who worked in the cybersecurity department and went missing in late June - has been a highly contentious issue.
The government last week blamed the Islamist militant group Al-Shabaab for her death, prompting scores of angry posts on social media from people who said the agency itself had been involved. Al-Shabaab took the unusual step of denying any involvement.
"This is a very serious issue," said Rashid Abdi, a Nairobi-based independent analyst.
"It will most likely sow serious divisions within the security services and result in the type of violence we saw in April between the fragmented security forces."
In April, factions of the security forces seized positions in the capital, angered by moves to extend the president's four-year term by another two years, which the opposition said was part of a power grab.
That confrontation was resolved when the president put the prime minister in charge of security and organizing delayed indirect elections.
Voting for lawmakers by elders had been due to be completed this week, with the election of a speaker and swearing in of members of parliament happening next week - in time for them to pick a president on Oct. 10.
But in a separate development on Monday, voting for members of the lower house of parliament was rescheduled to late November, causing a further delay to the whole process.