# The Sultanate of Mogadishu: the city and its rulers, 900s–1800s

> The Sultanate of Mogadishu from the record: founding traditions, Ibn Battuta in 1331, the Portuguese in 1499, Barbosa, the Muzaffar dynasty and the Abgaal imams.

Source page: https://calankii.com/en/history/sultanate-of-mogadishu/
Last checked: 2026-11-12
Publisher: Calankii (https://calankii.com)

## In short

Mogadishu was one of the main Muslim trading cities of the East African coast. By the 1300s it had its own ruler, whom its people called "the Shaykh". Travellers and sailors from Morocco, Portugal and China described it between the 1300s and 1500s ([Library of Congress, *Somalia: A Country Study*](https://countrystudies.us/somalia/6.htm)).

Most of what is known about its rulers comes from these visitors, from coins, and from traditions told in the city and written down by the French naval officer Charles Guillain in the 1840s ([Guillain, *Documents sur l'histoire... de l'Afrique orientale*, part 2, vol. 1, pp. 524–525](https://archive.org/details/documentssurlhis21guil)).

## Founding traditions

- **Before Islam.** Guillain reported "an old local tradition" that a town stood on the site before the birth of Islam. He wrote that "the fact is not impossible" (p. 524).
- **The Muslim city.** He dated the present town, founded by Muslim Arabs, to the year 295 of the Hijra, about 907–908 CE (p. 524).
- **Ninth century.** The Library of Congress writes that Mogadishu "dates back at least to the ninth century, when Persian and Arabian immigrants intermingled with Somali elements" ([Library of Congress](https://countrystudies.us/somalia/6.htm)).
- **The name.** The same source gives two readings: from the Arabic-Persian *maqad shah*, "seat of the shah", or from a Swahili phrase for "last northern city". It says the meaning "is uncertain" (same source).

For the coast before 1300, see [early Mogadishu and the Benadir coast before 1300](/en/history/early-mogadishu-and-the-benadir-coast-before-1300/).

## Ibn Battuta, 1331

The Moroccan traveller Ibn Battuta sailed for fifteen days from Zeila and reached "Maqdashaw", which he called "an enormous town". He wrote that its people were merchants who slaughtered hundreds of camels every day ([Ibn Battuta, trans. Gibb 1929, pp. 110–111](https://archive.org/details/dli.ernet.16353)).

- **The ruler.** "They call the sultan 'the Shaykh'." His name was Abu Bakr, and he was "of [Berberah](/en/history/early-berbera-before-1300/) origin, and he talks in the Maqdishi language, though he knows Arabic" (same source).
- **The court.** A *qadi* (judge) and *wazirs* (ministers) served him. On Fridays he walked from the mosque to his palace under "four canopies of coloured silk, each surmounted by a golden bird" (same source).
- **Trade.** Young men met each ship in small boats and took a merchant as their guest. The host sold and bought for him, and a sale made without the host was "regarded by them as invalid" (same source).

The full visit is told in [Ibn Battuta in Mogadishu and Zeila, 1331](/en/history/ibn-battuta-in-mogadishu-and-zeila-1331/).

## Contact with China, 1400s

A note in the 1898 Hakluyt edition of Vasco da Gama's journal, citing the Russian scholar Bretschneider, records that "in 1417 an embassy was sent from Mu-ku-tu-su (Magadoxo) to China" ([Ravenstein, *A Journal of the First Voyage of Vasco da Gama*, 1898](https://archive.org/details/ajournalfirstvo00ravegoog)).

## The Portuguese, 1499–1506

- **2–3 January 1499.** Returning from India, Vasco da Gama's ships passed "a large town, with houses of several stories, big palaces in its centre, and four towers around it", called Magadoxo. The journal says: "When we were quite close to it we fired off many bombards" ([Ravenstein 1898, p. 88](https://archive.org/details/ajournalfirstvo00ravegoog)). Ravenstein's note says it is "not clear" whether this was "a sign of rejoicing or in wanton enmity" (same page).
- **1500 and 1506.** According to Dames's notes on Barbosa, Cabral described it in 1500 as "a very rich and beautiful town of Moors" without landing, and Tristão da Cunha passed it without landing in 1506 ([Barbosa, trans. Dames, vol. 1, p. 31](https://archive.org/details/bookofduartebarb0001mans)).

## Barbosa's description, about 1516

The Portuguese official Duarte Barbosa wrote ([Barbosa, trans. Dames, vol. 1, p. 31](https://archive.org/details/bookofduartebarb0001mans)):

- **The town.** "A very great Moorish town called Magadoxo; it has a king over it."
- **Trade.** Ships came from Cambay in India and from Aden, bringing cloth and spices, "and they carry away much gold, ivory, wax and many other things".
- **Food.** "Flesh-meat in great plenty, wheat, barley, horses and fruit of divers kinds, so that it is a place of great wealth."
- **The people.** "They speak Arabic. The men are for the most part brown and black, but a few are fair. They have but few weapons, yet they use herbs on their arrows."

Dames added that "the Portuguese rule was never consolidated as far north as Magadoxo" (same page). The Library of Congress writes that among Somali towns "only Mogadishu successfully resisted the repeated depredations of the Portuguese" ([Library of Congress](https://countrystudies.us/somalia/6.htm)).

## The Muzaffar dynasty and the Abgaal

Guillain recorded the tradition told in the city in the 1840s (pp. 524–525):

- **The Muzaffar.** Mogadishu prospered under "the dynasty of the M'doffeur sultans", usually written Muzaffar.
- **The Ajuran.** The city stood on the coast of the territory of the "Odjourane", the Ajuran. See [the Ajuran state](/en/history/ajuran-state/).
- **The Abgaal.** "At a time that I cannot fix", an Abgaal group moved into Ajuran territory. "After a long war" the city "fell into the hands of the chief of the [Abgal](/en/society/abgaal/), Omar Djéloulé", and his descendants kept authority "with the title of sultan".
- **The cause, as told.** The attack was said to have been urged by a leading townsman who had been mistreated by "the sultan Fekheur-ed-Din", the reigning Muzaffar, and who took refuge with the Abgaal.

Ravenstein, in 1898, wrote that the city reached its height under the Muzaffar, "which was expelled by the Abgal Somal, probably in the sixteenth century" ([Ravenstein 1898, p. 88, note](https://archive.org/details/ajournalfirstvo00ravegoog)).

Guillain wrote that "under the domination of these half-savage conquerors, the decline of the Arab city must have happened quickly", and that the town split into two quarters, Hamarweyne and Shingaani (p. 525). These are his words, not a finding of later research.

## The Abgaal imams, as listed in the 1840s

Guillain was given this list of Abgaal rulers, from the founder to the ruler of his day (p. 525):

| Order | Ruler |
|---|---|
| 1 | Imam Djéloulé |
| 2 | Imam Omar |
| 3 | Imam Ahmed |
| 4 | Imam Mohammed |
| 5 | Imam Ahmed |
| 6 | Imam Mahmoud |
| 7 | Imam Ali |
| 8 | Imam Osman |
| 9 | Imam Mohammed |
| 10 | Imam Ahmed, the ruling *cheikh* when Guillain visited |

Guillain names the conqueror as "Omar Djéloulé"; his list gives Imam Omar and Imam Djéloulé as two names. He wrote that Sultan Ahmed promised him a family tree of "thirty names" back to Yacoub, the founder of the line, but that he forgot to remind him of it (p. 525).

## Later rule

- **1586.** According to Dames, the city "fell into the hands of the Turkish raider 'Ali Bey in 1586, but Turkish rule did not last long" ([Barbosa, trans. Dames, vol. 1, p. 31, note](https://archive.org/details/bookofduartebarb0001mans)).
- **1828 onwards.** Dames writes that Sayyid Said of Muscat "took possession of it in 1828", and that it then formed part of the Muscat and Zanzibar domain (same note). See [the sultanates, the coast and customary law, 1700s–1880s](/en/history/sultanates-the-coast-and-customary-law-1700s-1880s/).

## Sources differ

- **When the city was founded.** Guillain gives 295 AH (about 907–908 CE). The Library of Congress says "at least" the 9th century. Others date the sultanate itself to the 13th century or about 1330 (["Sultanate of Mogadishu", Wikipedia](https://en.wikipedia.org/wiki/Sultanate_of_Mogadishu)).
- **Who the rulers were.** Ibn Battuta called Abu Bakr "of Berberah origin", a term he used for Somalis. Some later historians, as cited on Wikipedia, describe the founder of the dynasty, Fakhr ad-Din, as of Arab descent (same source).
- **The name Fakhr ad-Din.** Wikipedia gives it to the founder of an early dynasty. Guillain gives it to the last Muzaffar sultan before the Abgaal took the city.
- **When the Abgaal took the city.** Guillain could not fix a date. Ravenstein wrote "probably in the sixteenth century".
- **Barbosa's description of the people.** Barbosa wrote that the people "speak Arabic". Ibn Battuta, two centuries earlier, said the ruler spoke "the Maqdishi language".

## Read the primary sources yourself

- Ibn Battuta, *Travels in Asia and Africa 1325–1354*, trans. H. A. R. Gibb (1929), pp. 110–111: [Internet Archive](https://archive.org/details/dli.ernet.16353).
- *A Journal of the First Voyage of Vasco da Gama, 1497–1499*, trans. E. G. Ravenstein (Hakluyt Society, 1898), p. 88: [Internet Archive](https://archive.org/details/ajournalfirstvo00ravegoog).
- *The Book of Duarte Barbosa*, trans. M. L. Dames (Hakluyt Society, 1918), vol. 1, p. 31: [Internet Archive](https://archive.org/details/bookofduartebarb0001mans).
- Charles Guillain, *Documents sur l'histoire, la géographie et le commerce de l'Afrique orientale*, part 2, vol. 1 (Paris, 1856), pp. 524–525, in French: [Internet Archive](https://archive.org/details/documentssurlhis21guil).
- Library of Congress, *Somalia: A Country Study* (1993), "Mogadishu and its Banaadir hinterlands": [text](https://countrystudies.us/somalia/6.htm).

## Related pages

- [Mogadishu and Brava in João de Barros's Décadas da Ásia, 1503–1510](/en/history/mogadishu-and-brava-in-joao-de-barros/)

---
I want to help with this: email hello@calankii.com. Fix this page: email hello@calankii.com with the page link and your source.
