Mogadishu has a long history, which ranges from the ancient period up until the present, serving as the capital of the influential Sultanate of Mogadishu in the 9th-13th century, which for many centuries controlled the Indian Ocean gold trade, and eventually came under the Ajuran Empire in the 13th century which was an important player in the medieval Silk Road maritime trade. Mogadishu enjoyed the height of its prosperity during the 14th and 15th centuries and was during the early modern period considered the wealthiest city on the East African coast, as well as the center of a thriving textile industry. In the 17th century, Mogadishu and parts of southern Somalia fell under the Hiraab Imamate and in the 19th century came under the Geledi Sultanate's sphere of influence.