MOGADISHU. — Somalia’s Islamist al Shabaab militia has executed a Ugandan soldier captured more than a year ago, according to a video released online by the militants and confirmed by their spokesman.

Henry Obbo, Uganda’s deputy military spokesman, told Reuters they were not aware of the video posted late on Tuesday.

The Ugandan military has previously confirmed that the captive, who has appeared in another video, was their soldier.

Ugandan soldiers form a large part of the 22 000-strong African Union peacekeeping force that defends Somalia’s weak Western-backed government against the Islamist insurgents.

The AU force has been battling al Shabaab for nearly a decade and has pushed the militants out of the country’s capital Mogadishu and many other former strongholds in the Horn of Africa nation. But al Shabaab is still able to carry out deadly bombings and mount devastating assaults on AU and Somali national army bases.

Al Shabaab holds an unknown number of Kenyan and Ugandan soldiers as hostages.

The video is entitled “So they may take heed, the final message from the Ugandan POW” and showed a soldier previously identified as Massasa M.Y. speaking.

“To those who are preparing to come here, sit down and think deeply . . . then ask yourselves whether you will return home safely,” the soldier said, according to an accompanying translation of his remarks, which were in Swahili.

“What awaits you here is death.”

The soldier, wearing a military uniform with a Ugandan insignia, says al Shabaab captured him in September 2015 during an attack on a base at Janaale, about 90 kilometres south of Mogadishu.

He said his message was directed at other Ugandan soldiers planning to embark on the “same journey that brought me here to Somalia”.

The soldier’s death was not shown but after he finished speaking, the video cut to another image and the sound of gunfire was heard.

Al Shabaab’s military operations spokesman, Sheikh Abdiasis Abu Musab, told Reuters by phone that he had been executed.

In a previous video released in September last year, Massasa said about 40 to 50 of his colleagues had been killed in the Janaale attack.

He pleaded with the Ugandan government to try to secure his release.

Countries in the African Union force, such as Uganda, Burundi, Ethiopia and Kenya, typically do not release the numbers of those killed, injured or captured in Somalia. — Reuters.