Djenné, the oldest known city in sub-Saharan Africa is situated on the floodlands of the Niger and Bani rivers, 354 kilometers (220 miles) southwest of Timbuktu. Founded by merchants around 800 AD (near the site of an older city dating from 250BC), Djenné flourished as a meeting place for traders from the deserts of Sudan and the tropical forests of Guinea. Captured by the Songhai emperor Sonni 'Ali in 1468, it developed into Mali's most important trading center during the 16th century. The city thrived because of its direct connection by river with Timbuktu and from its situation at the head of trade routes leading to gold and salt mines. Between 1591 and 1780, Djenné was controlled by Moroccan kings and during these years its markets further expanded, featuring products from throughout the vast regions of North and Central Africa. In 1861 the city was conquered by the Tukulor emperor al-Hajj 'Umar and was then occupied by the French in 1893. Thereafter, its commercial functions were taken over by the town of Mopti, which is situated at the confluence of the Niger and Bani rivers, 90 kilometers to the northeast. Djenné is now an agricultural trade center, of diminished importance, with several beautiful examples of Muslim architecture, including its Great Mosque. .
In addition to its commercial importance, Djenné, was also known as a center of Islamic learning and pilgrimage, attracting students and pilgrims from all over West Africa. The large market square of Djenné is dominated by its Great Mosque. Tradition has it that the first mosque was built in 1240 by the sultan Koi Kunboro, who converted to Islam and turned his palace into a mosque. Very little is known about the appearance of the first mosque, but it was considered too sumptuous by Sheikh Amadou, the ruler of Djenné in the early nineteenth century. The Sheikh built a second mosque in the 1830's and allowed the first one to fall into disrepair.