Somalia is facing a fresh test of its stability as foreign troops begin withdrawing, funding for its security forces comes under pressure and a bitter political dispute threatens to derail plans for the country's first direct democratic elections in decades. This was reported by Qazaqyia.kz citing BBC News.

The combination of challenges has raised questions about whether the government can defend itself against Islamist militant group al-Shabab while managing growing divisions among political factions.

Some analysts fear the situation could embolden al-Shabab, which is affiliated with al-Qaeda, and potentially allow it to seize control of the capital, Mogadishu. The group already controls large parts of the country despite the presence of about 12,000 African Union (AU) troops supporting the government.

The withdrawal of foreign forces, alongside the activities of clan-based militias aligned with rival political factions, has heightened concerns about the government's ability to maintain control.

Ugandan troops, who make up the largest contingent of the AU force, began withdrawing last month, with the country expected to complete its withdrawal by next year. Ethiopia, another major contributor to the AU mission with over 7,000 troops, is also reportedly planning to withdraw about 3,000 troops.

The US, which had earlier announced cuts to funding for the UN Support Office in Somalia (UNSOS) has since said it is extending it for a year. Washington contributes about a quarter of $500m UNSOS's annual budget, which supports Somali security forces, AU missions and individual troop-contributing nations.

With military support uncertain and the government facing mounting political challenges, analysts question whether Somalia's security forces are ready to stand on their own.

The concerns were heightened recently when al-Shabab claimed to have killed hundreds of elite Somali soldiers in an attack. The government acknowledged the attack but did not disclose the number of casualties.

Abdisalam Guleid, a former deputy director of Somalia's National Security Agency, told the BBC the security situation was increasingly precarious.

He warned that the withdrawal of foreign troops could leave Mogadishu vulnerable to a takeover similar to that of Afghanistan by the Taliban in 2021, following the withdrawal of US and Nato forces.

"I don't think Mogadishu will be able to defend itself. The Taliban style [takeover]… that's the most likely scenario I can envision now," he said.

The Taliban took over control of Afghanistan between 6-15 August 2021 in a rapid offensive, following the withdrawal of US and NATO forces.

Such a scenario has played out in Somalia in the past, Guleid explains.

Somalia has experienced the collapse of central authority before. In the early 1990s, clan-based rebel groups advanced on Mogadishu from several fronts, forcing then-President Mohamed Siad Barre from power.

His overthrow triggered a devastating civil war and a prolonged humanitarian crisis. The collapse of state institutions subsequently created conditions in which Islamist militant groups, including al-Shabab, were able to expand their influence.

Guleid says Ugandan troops have been central to preventing a similar collapse since their first deployment to Somalia in 2007. They played a key role in driving al-Shabab out of Mogadishu and other major towns, while protecting strategic installations, including the airport, seaport, government institutions and diplomatic missions.

Troops from Burundi, Djibouti, Kenya, Sierra Leone and Ethiopia later joined the AU mission, while countries including Turkey and the US maintained separate military deployments and provided training and equipment to Somali forces.

But Guleid argues that years of international assistance have not translated into sufficient military independence for the Somali government. He says the authorities have become so reliant on foreign protection that they have neglected to adequately prepare their own forces to take over.

Somalia's Information Minister Abdifatah Qasim Mohamud rejected suggestions that the country would be unable to cope with the withdrawals. He told the BBC that Somali troops had already taken over some positions vacated by Ugandan forces and were prepared to assume greater responsibility for the country's security.

He says Somalia could not depend indefinitely on foreign troops for its protection. "I believe there is no reason for concern over this issue. There will be no change in the country's security situation or in the areas they have vacated," he said.

President Hassan Sheikh Mohamud has also been seeking continued international backing.