The history of the Mali Empire begins when the first Mande people entered the Manding region during the period of the Ghana Empire. After its fall, the various tribes established independent chiefdoms. In the 12th century, these were briefly conquered by the Sosso Empire under Soumaoro Kante. He was in turn defeated by a Mande coalition led by Sundiata Keita, who founded the Mali Empire.
The Keita dynasty ruled the Empire for its entire history, with the exception of the third mansa, Sakura, who was a freed slave who took power from one of Sundiata's sons. Upon his death, the Keita line was re-established, and soon led the empire to the peak of its wealth and renown under Mansa Musa. His pilgrimage to Mecca in 1324 became legendary for the vast sums of gold that he gave as gifts and alms, to the point where it created an inflationary crisis in Egypt. Mansa Musa also extended the empire to its greatest territorial extent, re-annexing the city of Gao in the east.
After Mansa Musa's death, the empire slowly weakened. By the mid 15th century, the Sunni dynasty of Gao had established themselves as an independent power. Sunni Ali established the rival Songhai Empire and pushed the Malians out of the Niger bend region and back to their core territories in the south and west. The next century and a half saw Mali repeatedly battle the Songhai and the rising power of the Fula warlords Tenguella and his son Koli Tenguella.
When the Songhai were destroyed by a Moroccan invasion in 1593, Mansa Mahmud IV saw an opportunity to restore Malian pre-eminence in the Niger bend, but a catastrophic defeat outside Jenne in 1599 crippled his prestige. Upon his death, his sons fought over the throne and the empire splintered.