Local tradition dates the founding of Timbuktu to around the year 1100 CE, at a seasonal nomad camp based around a well, maintained by an old woman named Baktu and her slaves. Timbuktu, which translates to, 'the well of Baktu' is derived from this narrative. As early as the twelfth century, Timbuktu, located on the southern edge of the Sahara, functioned as an active trading post on the routes crossing the Sahara into West Africa. By the fourteenth-century the town was absorbed by the Mali Empire and settled into a period of general prosperity, of which the Djingareyber Mosque (Great Mosque) built in 1325 by the Andalucian architect and poet Abu Ishaq Es-Saheli, is a symbol.
After a period of control by the Tuareg, Timbuktu fell under Songhai rule in the middle of the fifteenth century. Until the Moroccan invasion at the end of the sixteenth century, this was Timbuktu's most brilliant epoch as a centre of Islamic learning, during which the city housed more than one hundred and fifty Islamic schools, accommodating students from as far away as North Africa and the Middle East. Many mosques, including the Sid Yahya Mosque and the Sankoré Mosque were built during this period. The Sankoré Mosque, whose dimensions were designed to conform to those of the Kabaa become a particularly important center for Islamic studies in Timbuktu. During this time, the qadi (judge) of Timbuktu, Al Hadj al-Aqib, also organized extensive remodelling of the Djingareyber Mosque; supporting the addition of the southern part of the present building, which is distinguished by the use of arches instead of wooden lintels for arcades between the aisles.
After the Moroccan invasion, raids by the Bambara, Peul and Tuareg tribes and drought and famine caused the decline of Timbuktu. The Tuaregs ruled the town from the eighteenth century through most of the nineteenth century, until the Tukular took over for thirty years before the arrival of French troops in 1893. With the arrival of French troops, came the construction of residential and governmental buildings in the south of the city, many of which were constructed from stone. Seen as a remote outpost of the desert by the French however, Timbuktu remained largely isolated, even after Mali's independence in 1958. In 1990 the 'Tuareg Revolt' broke out to the north. An insurrection with complex causes, the revolt brought unrest to the region for almost six years and focused attention on the problems of development in the area. On the fringes of the town, a large open space and the beginnings of a park mark the site of the 'Flame of Peace', a conciliatory memorial created in March 1996 between the conflicting parties, celebrated by the public burning of all weapons and the planting of trees.
In 1992, the old town of Timbuktu, with its mosques, scholars' and explorers' houses, university, tombs and mausoleums, was declared a World Heritage Site. The recognition of Timbuktu's importance to the cultural patrimony of Mali and the whole world has shown the town in a new light. The economy benefited from a subsequent increase in tourism until kidnappings in the region in 2008, and in the city itself in 2011. Between 2011 and 2013 government and rebel forces fought for control over the city. Several mausolea were destroyed by militants during that period. In 2013 fleeing militants set fire to the Ahmed Baba Institute of Higher Learning and Islamic Research, established in 1973. Fortunately, more than 30,000 rare manuscripts were successfully removed from the site prior to the attack.
In 2016 a member of a militant Islamist rebel group pled guilty to destroying shrines and damaging a mosque at the International Criminal Court (ICC) in the Hague. The prosecution was the first time the ICC prosecuted the destruction of cultural heritage as a war crime.