A zaouia or zawiya (Arabic: z?wiyah; "assembly" "group" or "circle", also spelled zawiyah, zawiyya, zaouiya, zaouïa and zwaya) is an Islamic religious school or monastery. The term is Maghrebi and West African, roughly corresponding to the Eastern term madrasa. A zawiya often contains a pool, and sometimes a fountain.
In precolonial times, these were the primary sources for education in the area, and taught basic literacy to a large proportion of children even in quite remote mountainous areas - leading to speculation that literacy rates in Algeria at the time of the French conquest in 1830 may have been higher than those of European France. Their curriculum began with memorization of the Arabic alphabet and the later, shorter suras of the Qur'an; if a student was sufficiently interested or apt, it progressed to law (fiqh), theology, Arabic grammar (usually taught with ibn Adjurrum's famous summary), mathematics (mainly as it pertained to the complex legal system of inheritance distribution), and sometimes astronomy. These are still operational throughout the Maghreb, and continue to be a major educational resource in the Sahel of West Africa, from Mauritania to Nigeria.
In the Arab world, the term zawiya can also refer to a Sufi lodge, akin to the term Tekke/Tekyeh in Iran, Turkey and the former Ottoman areas, as well as khanqah or dargah used in various parts of Asia. An example is the Hilaliyya Zawiya in Syria. One of the best known living or contemporary zawiyas is the Zawiya of Sheikh Ahmed Tijani located in Fes, Morocco. There are several extensions or sub-zawiyas affiliated with this Zawiya located in various places around the world.
Among the Hassaniya Arabic-speaking populations of Mauritania, Western Sahara, Morocco, Mali and Algeria (often referred to as Sahrawis), the term is also used to signify a certain type of tribe. Sahrawi society was traditionally (and still is, to some extent) stratified into several tribal castes, with the Hassane warrior tribes ruling and extracting tribute--horma--from the subservient Sanhaja Berbers. A middle caste was formed by the Zawaya, or scholarly tribes, who provided religious instruction and services. This did not necessarily mean that they maintained a monastery or school as described above, since all these tribes were more or less nomadic. However, important sheikhs and Sufis would sometimes create schools, or, after their deaths, their mazar (mausoleum) would turn into holy places of significance to the tribe.
Often, the Zawaya were descended from Sanhaja, while the Hassane claimed lineage from the Beni ?ass?n, who are identified as Arabs. Even if intermarriage and tribal alliances made the distinction difficult to maintain from a scientific perspective, it was culturally important; however, from about the 19th century, most or all Sahrawi tribes had adopted Hassaniya Arabic and come to regard themselves as Arabs. Sometimes, the Zawaya and Hassane roles changed with this: military and economic strength would often lead to a gradual redefinition of the tribe's role, and, simultaneously, to its self-perception of religious and ethnic background. Especially in the northern Hassane areas, i.e. today's Western Sahara, the Zawaya tribes were more or less synonymous with the Chorfa, tribes who claimed descent from Muhammad. In the areas corresponding broadly to today's Mauritania, this was not necessarily so; there, the name "Marabout" is also used synonymously with "Zawaya" in its tribal meaning.