For many years , Mogadishu stood as the pre @-@ eminent city in the Bilad @-@ ul @-@ Barbar ( بلاد البربر ) , meaning " Land of the Berbers , " which was the medieval Arabic term for the Somali coast . By the time of the Moroccan traveller Ibn Battuta 's appearance on the Somali coast in 1331 , the city was at the zenith of its prosperity . He described Mogadishu as " an exceedingly large city " with many rich merchants , which was famous for the high quality fabric that it exported to destinations including Egypt . Batutta added that the city was ruled by a Somali Sultan , Abu Bakr ibn Sayx ' Umar , who was originally from Barbara in northern Somalia and spoke both Somali ( referred to by Battuta as Mogadishan , the Benadir dialect of Somali ) and Arabic with equal fluency . The Sultan also had a retinue of wazirs ( ministers ) , legal experts , commanders , royal eunuchs , and other officials at his service .