He was born in the Ouarsenis mountains in present-day Algeria, in a family belonging to one of the Berber tribes in these mountains. His family moved to Tlemcen when he was a child. In Tlemcen, he studied and later taught Islamic law. He later moved to Fez, present-day Morocco. He became official mufti in Fez and became the leading living authority on the issues of Iberian Muslims living under Christian rule, after the Christian conquest of Islamic Al-Andalus. He died on the Tuesday, 20 June 1508. He was buried in Fez, in the Kudyat al-Baraṭil cemetery, near the tomb of ibn Abbad.
Works
His most notable work is al-Miyar al-Murib, a multivolume collection of legal opinions in North Africa and Islamic Spain. By the sixteenth century it became part of the educational curriculum in North Africa, and in modern times it is studied as a source of information on the religious and social practices of contemporary Islamic Spain and the Maghreb North Africa. Another work, Al-Manhaj al-Faaiq wa al-Manhal al-Raaiq fi Ahkam al-Wathaaiq consists of 16 chapters about notarization of Islamic legal documents. It includes the requirements and desired characters of a notary public, standards and requirements of an Islamic legal document, as well as notarial topics such as how to correctly date a legal document. In total, at least 15 of al-Wansharisi's works are extant, almost all in the topic of fiqh.
He also wrote Asna al-matajir fi bayan ahkam man ghalaba 'ala watanihi al-nasara wa lam yuhajir wa ma yatarattabu 'alayhi min al-'uqubat wa al-zawajir, an extensive fatwa arguing that it was compulsory for Muslims in Christian-conquered Spain to emigrate to Muslim lands. It was issued in 1491, shortly before the fall of Granada which marks the end of the reconquista. At this point, most of Spain excepting Granada were had been conquered by the Christians, and Muslims had already lived in these territories under Christian rule. In addition to citing the Qur'an, hadith and previous consensus of jurists, he also supported his case with a detailed demonstration of why the mudéjars were unable to properly fulfill a Muslim's ritual obligation. This fatwa is one of the most preeminent pre-modern legal opinions on Muslims living under non-Muslim rule, although it was issued in the context of Muslims in Iberia and North Africa. In addition to The Most Noble Commerce, he also wrote a shorter companion fatwa, sometimes called the "Marbella fatwa", responding to a question about a man from Marbella in Southern Spain who wished to stay in Christian Spain in order to assist those unable to migrate. These two fatwas were distributed as independent work, and are later included in his collection The ClearStandard. Al-Wansharisi's position, which emphasised the obligation to emigrate, was the predominant position of the Maliki school at the time. The Oran fatwa, issued in 1504 after the forced conversion in the Crown of Castile, was an exception to this majority opinion, arguing that it may be permissible for Spanish Muslims to stay and even outwardly conform to Christianity, when forced and necessary for survival.