# Early Mogadishu, Merca and Barawa before 1300: the first records and the mosque inscriptions of 1238 and 1269

> Mogadishu, Merca and Barawa before 1300 in al-Idrisi, Yaqut, Ibn Sa'id and Chinese sources, with the 1238 and 1269 mosque inscriptions and the founding traditions.

Source page: https://calankii.com/en/history/early-mogadishu-and-the-benadir-coast-before-1300/
Last checked: 2026-11-12
Publisher: Calankii (https://calankii.com)

## In short

The southern Somali coast, later called the Benadir, had trading towns long before 1300. The record before Ibn Battuta's visit in 1331 is thin but real: three Arab geographers, a Chinese customs official, oral traditions written down in the 1840s, and inscriptions carved in Mogadishu's mosques. This page gathers them. Ibn Battuta and later travellers are on [the Somali coast towns, 1331–1586](/en/history/somali-coast-towns-1331-1586/).

## The 1st-century coast: Azania

South of Ras [Hafun](/en/history/ancient-port-of-opone-ras-hafun/), the 1st-century *Periplus of the Erythraean Sea* describes the "Courses of [Azania](/en/history/greek-and-roman-writers-on-the-somali-coast/)", a coast "destitute of harbors" with anchorages, "the first being called Sarapion and the next Nicon" ([Schoff translation, 1912, §15, p. 28](https://archive.org/details/cu31924030139236)). The Periplus gives no towns or rulers on this stretch. See [the Somali ports in the Periplus](/en/history/periplus-somali-ports-1st-century/).

## Merca in 1154: al-Idrisi

Al-Idrisi, writing in Sicily in 1154, lists "the towns of Carfouna, of Markah and of El-Nedja" as belonging to the country of Berbera, on "the sea of Yemen". He writes that "the inhabitants of Berbera feed largely on the flesh of sea turtles, which they call *lebeh*". He describes a mountain called Khakoui "with seven very high peaks", which Guillain identified with Ras Hafun, and "two days from Markah, in the desert, a river which floods like the Nile, and on which durra is sown", a description of the [Shabelle](/en/economy/farming-and-harvests/) ([Guillain, *Documents sur l'histoire… de l'Afrique orientale*, part 1, 1856, pp. 192–193](https://archive.org/details/bub_gb_p43vUEwuZEoC), quoting Jaubert's translation of Idrisi; translated here).

## Mogadishu in the 1200s: Yaqut

Yaqut al-Hamawi wrote his dictionary of places, the *Mu'jam al-buldan*, "more than a century before the voyage of Ibn Battuta", in Guillain's words ([Guillain 1856, part 1, p. 289](https://archive.org/details/bub_gb_p43vUEwuZEoC)). Guillain translated the entry on Mogadishu from its abridgement ([Guillain 1856, part 1, pp. 234–235](https://archive.org/details/bub_gb_p43vUEwuZEoC), translated here):

> "Maqdishu is a town placed at the beginning of the country of the Zanj, south of Yemen, in the land of the Berbers and at the centre of their country. These Berbers are not the same as those who live in the west… The inhabitants of this town go naked, without clothing. They have no sultan; their affairs are managed and directed by *muqaddam*s [elders] chosen from among them. If a merchant comes to this country, he must stay with one of them, who protects him and acts as his patron. From this country are exported sandalwood, ebony, ambergris and ivory, which are the greatest riches of the country."

Guillain added that, from traditions he collected in Mogadishu, Yaqut's information "must refer to a time well before that in which he wrote", since sultans were already ruling the town in the early 1200s (same source, p. 235, note).

The custom of the merchant staying with a local host matches what Ibn Battuta saw in 1331, when each arriving merchant was taken in by a host who traded for him ([Gibb, *Ibn Battuta: Travels in Asia and Africa*, 1929, pp. 110–111](https://archive.org/details/in.ernet.dli.2015.62617)).

## Merca and Mogadishu in the 1200s: Ibn Sa'id

The 13th-century geographer Ibn Sa'id al-Maghribi writes ([Guillain 1856, part 1, pp. 238–239](https://archive.org/details/bub_gb_p43vUEwuZEoC), quoting Ibn Sa'id's geography; translated here):

- "Among the towns of the Berbers that are known on the seashore is that of [Merca](/en/regions/lower-shabelle/), whose inhabitants are Muslims… It is the capital of the country of the Hawiye, who form more than fifty tribes or villages. It lies on the banks of a river that comes out of the Nile of Maqdishu."
- "To the east of Merca is the Muslim town of Maqdishu, whose name comes up often in the mouths of those who have travelled in those parts… on the shore of the Indian Sea; its port offers little safety."
- He calls Berbera "the capital" of the Berber towns, and names a "great mountain well known to travellers", Hafuni, with seven capes that sailors "count and rejoice when they have passed".

## The mosque inscriptions of Mogadishu

The French naval officer Charles Guillain visited Mogadishu in 1847 and copied the Arabic inscriptions he found. He published them in French translation ([Guillain 1856, part 1, pp. 289, 612–613](https://archive.org/details/bub_gb_p43vUEwuZEoC)):

**The minaret of the Hamar Weyne mosque, 636 AH (1238 AD).** On the mosque still in use in Hamar Weyne, the minaret carries this text:

> "In the name of God, the Merciful, the Compassionate. The building of this minaret was begun in the first days of the month of Muharram of the year 636 of the hijra. May God bless him who instituted this era. May God forgive him who built it and took charge of it; may He forgive him, his father and his mother, and all Muslims… O God, all the deeds of your servant Muhammad ibn Abd al-Shaddad are done for You."

Guillain dates the start of Muharram 636 to August 1238. He describes the building as the one old mosque of the town "still used for worship and in fairly good condition, thanks to the successive restorations" (p. 289).

**A ruined mosque between Hamar Weyne and Shingani, 667 AH (1269 AD).** Guillain copied an inscription with a verse of the Qur'an ("Perform the prayer at the two ends of the day and at the approach of the night; truly good deeds remove evil deeds") and a prayer for its owner, "al-Hajj Muhammad ibn Abdallah al-Bahrani", dated "the end of Sha'ban of the year 667", which is April 1269.

**The Fakhr al-Din and Arba'a Rukun mosques, 667 AH (1269 AD).** The Fakhr al-Din mosque in Hamar Weyne carries an inscription of 667 AH (1269) naming its builder ([Archnet, Masjid Fakhr al-Din](https://next.archnet.org/sites/3781)). The Arba'a Rukun mosque in Shingani has a mihrab inscription of the same year naming its founder, Khusra ibn Mubarak al-Shirazi ([Garlake, *The Early Islamic Architecture of the East African Coast*, 1966, p. 10](https://books.google.com/books?id=IRINAQAAIAAJ)).

These inscriptions are among the oldest dated Islamic texts on the East African coast. An older epitaph from [Barawa](/en/regions/barawa/) is described below.

## How Mogadishu was founded: who says what

- **The tradition Guillain collected in 1847.** Guillain was told that the first Muslim settlers, whom he calls the "Emozeides", at first built houses of wood and straw covered with hides, which were slowly replaced by stone houses. Government passed down in the family of the leader of a later immigration, a dynasty called "El-M'doffeur" (the Muzaffar). The land between the lower [Jubba](/en/regions/jubba-river/) and the Shabelle "was then, it is said, very populous", and the area around the town was held by the Ajuran, "one of the great Hawiye tribes", who had friendly relations with the Muzaffar sultans and brought goods from the interior on camels. Each night after the evening prayer, criers walked the town calling "Let those from outside leave and the inhabitants stay at home", and the gates were shut. Under this dynasty, he was told, Mogadishu became "the capital of all the surrounding country", and families from it founded Barawa, Merca and other towns ([Guillain 1856, part 1, pp. 287–288](https://archive.org/details/bub_gb_p43vUEwuZEoC)).
- **Ibn Battuta, 1331.** He found the ruler, Abu Bakr, to be "of [Berberah](/en/history/early-berbera-before-1300/) origin", speaking "the Maqdishi language" as well as Arabic ([Gibb 1929, pp. 110–111](https://archive.org/details/in.ernet.dli.2015.62617)).
- **The archaeologist Sada Mire** argues from the ruined towns across the north that the region's medieval states were local settled kingdoms and "challenges the notion that Arabs had outposts there" ([Mire 2015, *African Archaeological Review* 32](https://link.springer.com/article/10.1007/s10437-015-9184-9)).

## How old is Mogadishu? Who says what

- **Enrico Cerulli**, the Italian scholar who studied the town's Arabic chronicles, held that Mogadishu grew between 900 and 1250 as a settlement of Arab merchants, organised from the 10th century as a federation of 39 clans from 5 tribes. The clans of the Muqri tribe took the *nisba* al-Khatani and won the right to choose the federation's *qadi* (judge) from among themselves (summarised by E. van Donzel, quoted in [Fauvelle-Aymar et al., *Espaces musulmans de la Corne de l'Afrique au Moyen Âge*, 2011, ch. 2, §§87–88](https://books.openedition.org/cfee/714)).
- **Neville Chittick**, who excavated on the Somali and Swahili coasts, concluded: "there is no firm evidence of the existence of a town on the site of Mogadishu before the late 12th century. It is perhaps most likely that it grew during that century to its state of florescence, which was evidently primarily in the 13th and 14th century" (Chittick 1982, p. 61, quoted in the same source, §88).
- **Ibn al-Mujawir**, writing soon after 1229, tells that the Banu Majid, driven out of Yemen in 1159, split into three groups, one of which settled at Mogadishu, one at Zafar in Yemen and one at Zeila (cited after Trimingham 1975, p. 124, in the same source, note 103).

## Barawa's epitaph of 1105

According to Cerulli's studies, the oldest known Arabic inscription in Somalia is an epitaph at Barawa dated 498 AH, which is 1105 AD (van Donzel, quoted in [Fauvelle-Aymar et al., *Espaces musulmans de la Corne de l'Afrique au Moyen Âge*, 2011, ch. 2, §§87–88](https://books.openedition.org/cfee/714)). That makes it older than the Mogadishu inscriptions of 1238 and 1269.

## Mogadishu in the Chinese record, 1225

Zhao Rugua's description of Chung-li, which his translators identify with the Somali coast, tells of a king who "lives in a brick house covered with glazed tiles", courtiers who alone could wear jackets and turbans, and people who lived in palm-leaf huts and ate "baked flour cakes, sheep's and camel's milk". The translators suggest that "the town in which the king of Chung-li lived may well have been Magadoxo" ([Hirth and Rockhill, *Chau Ju-kua*, 1911, pp. 130–132](https://archive.org/details/chaujukuahiswork00chauuoft)). See [Chinese records of the Somali coast](/en/history/chinese-records-of-the-somali-coast/).

## Related pages

- [Before 1300: the ancient Somali lands](/en/history/ancient-somali-lands-before-1300/)
- [Mogadishu, Zeila, Berbera and Barawa, 1331–1586](/en/history/somali-coast-towns-1331-1586/)
- [Medieval and early modern polities, 1300s–1700s](/en/history/medieval-and-early-modern-polities-1300s-1700s/)
- [Zeila, Berbera and Mogadishu in the records of Rasulid Yemen, 1229–1454](/en/history/rasulid-yemen-and-somali-ports-1229-1454/)
- [Marco Polo and the Somali coast, about 1298](/en/history/marco-polo-and-the-somali-coast/)
- [Scholars from Zeila and the Horn in medieval Yemen, 1150–1450](/en/history/zeila-and-jabarti-scholars-in-medieval-yemen/)
- [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.
