Mohamed Jama, a resident in the coastal town of Merca, told the Associated Press that dozens of masked fighters tied up the three men and killed them by firing squad.
A self-proclaimed militant judge gave the death penalty order. Hundreds of residents were forced to watch, and many of them vomited after the killings, Mr. Jama said.
“The execution and the verdict were quick and dirty. It was gruesome to watch,” he said. “The men instantly died after their bodies were riddled by bullets.”
A U.S. Embassy spokesman said he was not aware of the executions, but that in general the United States does not comment on intelligence matters.
An al-Shabab member, who gave his name as Abu Abdalla, said militants interrogated the men for six months before the executions.
Al-Shabab said on its official Twitter feed the three men “were part of a wide network of spies deployed by the British and American intelligence agencies” to spy on al-Shabab. It added that Western powers can not coordinate airstrikes without relying on human intelligence.
Dozens of American and British citizens, usually of Somali origin, have joined al-Shabab, and officials in both countries worry that members of al-Shabab holding U.S. or U.K. passports could return to carry out terror attacks in those countries.
The Twitter postings said two of the accused spies planted tracking devices on a vehicle that was hit by a missile strike on the outskirts of Mogadishu in January. Bilal Al-Berjawi, a British fighter of Lebanese descent, was killed in that strike.
Over the past year, al-Shabab has lost control of Mogadishu and ceded power in towns in western Somalia. The militants have largely either fled to northern Somalia and Yemen, or have retreated to Kismayo and Merca, the last two major towns their control.
'Your papers, please' must never be heard in America
Independent voices from the TWT Communities
Television commentary, reviews, news and nonstop DVR catch-up.
In a world that is increasingly complex, we need to seek greater awareness of the blending of cultures and America's changing role in a global community.
Eat & drink your way to better health, a better body and a better planet.
Let’s talk about everything, especially the absurdity of it all
Benghazi: The anatomy of a scandal
Vietnam Memorial adds four names
Cinco de Mayo on the Mall