According to its chroniclers, such as Al-Sa`di, Timbuktu was founded by a nomadic Berber tribe, the otherwise unknown Maghsharan; they established it by settling some slaves there to take care of their property while they were away. These slaves probably spoke a Songhay language ancestral to the dominant language of modern Timbuktu, Koyra Chiini. When Ibn Battuta passed by it around 1352, he commented that "most of its inhabitants are of the Massufa [Inusufa] tribe, wearers of the face-veil". Contrary to initial appearances, this actually highlights its multiethnic history: there are still Inusufa in northern Niger, and many of them speak a language of their own mixing Songhay and Tuareg elements, Tasawaq.
During its heyday before Morocco conquered it, the world of Timbuktu scholarship was even more multiethnic than the town itself. The most famous of the Timbuktu scholars, Ahmad Baba, belonged to the Massufa, but studied under the Mande scholar Muhammad Baghayogho; other scholars came from the Soninke (such as Ahmad Kati), the Fulani (such as Muhammad al-Kaburi), and other groups. The Arab presence at this period was minimal, although Sidi Yahya came from the Thaaliba Arab tribe of north-central Algeria; that would change later, as the tribes of the western Azawad - notably the Kunta - shifted their identities and languages. But the language of scholarship linking these diverse groups was Arabic, and the vast majority of the manuscripts are written in Arabic. The exceptions have not been well-studied, but reportedly include religious poems in Songhay and Fulani and a medical manuscript in Tamashek.
In 1986, according to Jeffrey Heath, the first languages spoken at the town were as follows: 80% Koyra Chiini (Songhay), 10% Tamasheq, 10% Arabic. Most of the Tuaregs and Arabs were driven out during the Tuareg rebellion of 1990-1994, but many came back afterwards. Right now, the situation is in flux: reporting indicates that "white" people's shops are being looted in revenge for their perceived support of the rebels. (Yes, many Tuaregs are black by American or European standards; but other Malians consider them white, and not without reason when the point of reference is the skin colour of other West Africans.)