The Songhai Empire was a state located in the western part of the Sahel during the 15th and 16th centuries. At its peak, it was one of the largest African empires in history, stretching from the Atlantic Ocean to what is now Northwest Nigeria and central Niger. The state is known by its historiographical name, derived from its largest ethnic group and ruling elite, the Songhai people. Sonni Ali established Gao as the empires capital, although a Songhai state had existed in and around Gao since the 11th century. The empire grew after the decline of the Mali Empire, and the Songhai people broke away from Mali control after Mansa Musas death. The Songhai Empire was centered in the city of Gao along the Niger River, and the Songhai built up a large army and expanded their territory. Sunni Ali took power in 1464 and became the first king of the Songhai Empire. He further expanded the empire and conquered Timbuktu and Djenné, two important centers for trade and learning. At its peak under his reign, the Songhai Empire expanded to become larger than either the Ghana or Mali Empires. The Songhai economy was based on a clan system, and the most common occupations were metalworkers, fishermen, and carpenters. The Songhai Empire collapsed after the defeat at the Battle of Tondibi in 1591, when the Moroccan army invaded and conquered the empire.