Residents in a central Somali town say Islamic extremists have detained foreign sailors who may be Iranian and seized their fishing vessel that washed ashore on the Somali coast.

Yasin Maalin, a resident of El-Dher town in the coastal region of Galgadud, said on Wednesday that Somalia's al-Shabab rebels detained Iranian fishermen whose vessel had developed mechanical problems before it drifted into the militants' stronghold.

However, Ali Hussein, another resident, said the sailors' nationality was not immediately certain. It was not known how many they were.

It was not possible to get a comment from al-Shabab, the group that is allied with al-Qaida and has carried out many deadly attacks across Somalia.

Despite losing key cities and strongholds, al-Shabab still has control over territory in south and central Somalia.