Somalia’s president has signed into law an extension of his mandate and that of his government as the US and other countries threatened sanctions and warned of further instability in one of the world’s most fragile nations.

The stand-off over President Mohamed Abdullahi Mohamed’s time in office prolongs an election crisis after the national vote was delayed in February.

Critics said Mr Mohamed’s rule is over, while the international community objected to a mandate extension and warned that the al-Qaida-linked al-Shabab extremist group could take advantage of the country’s heated political divisions.

The president signed the controversial law after the lower house of parliament this week voted to effectively extend his mandate for two years while calling for direct elections during that time.

Leaders of the senate, however, called the vote illegal, and Somalia’s opposition have protested against the move.

The UK said this week’s move “undermines the credibility of Somalia’s leadership” and it threatened to work with international partners to “re-evaluate our relationship and the nature of our assistance to Somalia”.

US secretary of state Antony Blinken said the American administration is “deeply disappointed”, in a statement that threatened the possibility of sanctions, visa restrictions and a re-evaluation of “our bilateral relations”.

The statement called for Somalia’s federal government and regional states to urgently return to talks on the election crisis.

The European Union had warned that signing this week’s decision into law would divide Somalia and “constitute a grave threat to the peace and stability of Somalia and its neighbours”, and it threatened to consider “concrete measures” in response.

In response, Somalia’s foreign ministry said it was concerned by “misleading and alarmist statements” by some international partners, and accused them of “inciting the Somali people against their legitimate government”.

The statement added that Somalia will “reject any attempts to use the humanitarian assistance to blackmail the country”, without giving details.

Somalia relies heavily on outside aid to feed, shelter and care for a large population displaced by insecurity and climate shocks, as well as to train and equip its security forces.

In Somalia’s capital, Mogadishu, frustration deepened.

Civil society leader Abdullahi Mohamed Shirwa said: “What happened can be explained as a coup d’etat executed by a group of people who were hungry for power for so long.”

He added that “this is just like the craziest political gamble”, in a country already wrestling with humanitarian crises driven by instability and the changing climate.

Somalia’s government has been unable for months to reach agreement on how to carry out the election, with the regional states of Puntland and Jubbaland objecting on certain issues and the international community warning against holding a partial election.

The crisis led to deadly violence against demonstrators who opposed an election delay.

Contentious issues in months of talks on the election process included the formation of the electoral management commission, the selection of commission members for the breakaway region of Somaliland.

Somalia has not held a one-person-one-vote direct election in decades.

The country began to fall apart in 1991, when warlords ousted dictator Siad Barre and then turned on each other.

Years of conflict and attacks by al-Shabab, along with famine, left this Horn of Africa country of about 12 million people largely shattered.

Al-Shabab controls large parts of southern and central Somalia and often targets the capital with suicide bombings.

The extremist group has been a frequent target of US military air strikes.