“There has been gridlock within central government institutions going back four or five years, and constant feuding at the center over a whole range of issues, including this balance of power,” said Michael Woldemariam, an assistant professor of international relations at Boston University. “Then there’s the broader issue of the legislature, and how much autonomy and influence it should have.”

The fight for power also pits the country’s six states against the central government, a relationship that is defined primarily by a young — and provisional — Constitution.

“A lot of power, roles and responsibilities have not been clearly laid out” in that document, said Omar Mahmood, an analyst on the Horn of Africa for the Institute for Security Studies, who is based in Ethiopia.

There is a continuing process to create a permanent constitution, he said, “but ahead of that, people are jockeying for power and trying to influence it.”

Among those competing for influence are countries in the Persian Gulf region, whose politics are increasingly playing a role in Somalia.

A rift in the Gulf has pitted Saudi Arabia and the United Arab Emirates, which are major trading partners with Somalia, against Qatar, whose financial support was widely seen as a critical factor in Mr. Mohamed’s victory in last year’s presidential election.

Ahead of Mr. Jawari’s resignation, the government impounded a suitcase it said contained $9.6 million in cash, from a plane that had arrived from the United Arab Emirates. The Emirati ambassador said the money was intended to pay its soldiers, who are training Somali national forces, but the government said it was still investigating the matter.