Islamist commanders in the southern Somali port of Barawe said commandos -- presumed to be from a Western nation -- rappelled from a helicopter as they tried to storm a house belonging to a senior Shebab commander.
The assault comes two weeks after Shebab gunmen attacked Kenya's Westgate shopping mall, massacring 67 people in a four-day siege.
"The enemy of Allah tried to surprise the mujahedeen commanders with a night attack using a military helicopter, but they were taught a lesson and they have failed," Mohamed Abu Suleiman said, the Shebab commander in the small seaside town.
Shebab spokesman Abdulaziz Abu Musab said attackers also stormed the beach by boat.
Also Read
"The bungled operation was carried out by white people, who came with two small boats from a larger ship out at sea... one Shebab guard was killed, but reinforcements soon came and the foreigners fled," he said.
"Where the foreigners had been, afterwards we saw lots of blood, so maybe we wounded some," he added.
Witnesses reported heavy gunfire as the helicopter hovered overhead.
"I woke to the sound of the helicopter above the neighbourhood, then a few minutes later, there was fighting, gunfire broke out for about 10-15 minutes," a local resident said, who asked not to be named.
Barawe lies some 180 km south of the capital Mogadishu, and is one of the few ports left in Shebab hands, although they still control large parts of rural southern Somalia.
Photographs released by the Shebab earlier this year showed dozens of their fighters armed with heavy machine guns in Barawe.
Residents of Barawe said Shebab gunmen were heavily deployed on the streets of the port this morning.
"People are being stopped from getting close to the scene of the attack, heavily armed Shebab soldiers have cordoned off the area," said Mohamed Nune, a resident.
Last year, US Navy SEALs flying at least six military helicopters swooped into northern Somalia to rescue two aid workers held by pirates.