A

Abdullahi Hersi Eed, Puntland's Regional Attorney General said that the court sentenced the militants to death for their role in the attack, which left 24 soldiers dead and another 73 wounded in the region.

The militants were members of al-Shabaab, an organisation of Sunni extremists that has been fighting for the domination of Somalia for years.

The Islamist insurgents want to set up a theocracy in the country.

The sentenced militants were part of 97 al-Shabaab members captured in northern parts of the country. The defendants were given one month to appeal.

"All of the defendants admitted their guilt, insisting they took part in the recent attacks," Hersi Eed said.

The court delayed the hearings of two militants, who were under 16 years old.

READ: Kenyan forces kill 21 Al Shabaab fighters in Somalia

The semi-autonomous Puntland region has long been considered fairly stable.

However, in recent weeks there has been an increase in clashes between al-Shabaab fighters and the security forces.