Muhammad al-Tanasi (; born c. early 15th century â died 1494) commonly known as al-Hafid al-Tanasi, was a prominent Maghrebi jurist, historian, poet, and man of letters. Possibly born in Ténès, he spent the majority of his career in Tlemcen, where he became one of the city's most distinguished scholars. He is best known for his historical work, Nazm al-Durr wa al-'Iqyan, a significant source on the Zayyanid dynasty of Tlemcen and its rulers.
His full name was Muhammad ibn Abd Allah ibn Abd al-Jalil al-Tanasi, commonly known as al-Hafid al-Tanasi. Little is known about his early life, and the date of his birth remains uncertain. He is generally thought to have originated from Ténès (now in Algeria), from which his nisba al-Tanasi derives, though he spent much, perhaps most of his life in Tlemcen, which explains why the toponymic nisba al-Tilimsani was also applied to him.
Al-Maqqari refers to him as âÂÂMuhammad ibn Abd Allah ibn Abd al-Jalil al-Tanasi, then al-Tilimsani,â and elsewhere describes him as a resident of Tlemcen, indicating that he was not originally from the city but settled there later. A manuscript copied in his own hand at the end of the 8 volume of Ibn Hajar al-Asqalan<nowiki/>i's Fath al-Bari identifies him as âÂÂMuhammad ibn Abd Allah ibn Abd al-Jalil al-Amawi, then al-Tanasi.â This suggest an Umayyad affiliation.