Starting out as a seasonal settlement, Timbuktu became a permanent settlement early in the 12th century. After a shift in trading routes, Timbuktu flourished from the trade in salt, gold, ivory and slaves. It became part of the Mali Empire early in the 14th century. In the first half of the 15th century, the Tuareg tribes took control of the city for a short period until the expanding Songhai Empire absorbed the city in 1468. A Moroccan army defeated the Songhai in 1591 and made Timbuktu, rather than Gao, their capital. The invaders established a new ruling class, the Arma, who after 1612 became virtually independent of Morocco. However, the golden age of the city, during which it was a major learning and cultural centre of the Mali Empire, was over, and it entered a long period of decline. Different tribes governed until the French took over in 1893, a situation that lasted until it became part of the current Republic of Mali in 1960. Presently, Timbuktu is impoverished and suffers from desertification.
In its Golden Age, the town's numerous Islamic scholars and extensive trading network made possible an important book trade: together with the campuses of the Sankore Madrasah, an Islamic university, this established Timbuktu as a scholarly centre in Africa. Several notable historic writers, such as Shabeni and Leo Africanus, have described Timbuktu. These stories fuelled speculation in Europe, where the city's reputation shifted from being extremely rich to being mysterious.
Over the centuries, the spelling of Timbuktu has varied a great deal: from Tenbuch on the Catalan Atlas (1375), to traveller Antonio Malfante's Thambet, used in a letter he wrote in 1447 and also adopted by Alvise Cadamosto in his Voyages of Cadamosto, to Heinrich Barth's Timbúktu and Timbu'ktu. French spelling often appears in international reference as "Tombouctou." As well as its spelling, Timbuktu's toponymy is still open to discussion. At least four possible origins of the name of Timbuktu have been described:
The validity of these theories depends on the identity of the original founders of the city: as recently as 2000, archaeological research has not found remains dating from the 11th/12th century within the limits of the modern city given the difficulty of excavating through metres of sand that have buried the remains over the past centuries. Without consensus, the etymology of Timbuktu remains unclear.
Like other important Medieval West African towns such as Djenné (Jenné-Jeno), Gao, and Dia, Iron Age settlements have been discovered near Timbuktu that predate the traditional foundation date of the town. Although the accumulation of thick layers of sand has thwarted archaeological excavations in the town itself, some of the surrounding landscape is deflating and exposing pottery shards on the surface. A survey of the area by Susan and Roderick McIntosh in 1984 identified several Iron Age sites along the el-Ahmar, an ancient wadi system that passes a few kilometres to the east of the modern town.