In this article, I argue that drought and plague in 17th-century Morocco led to the increased importance of rural centers of scholarship. This increase in rural scholarship led to a changed intellectual culture in which rural imagery and Tamazight culture could play a greater role. To show these connections, I combine the fields of intellectual and environmental history while utilizing traditional analysis of textual sources alongside scientific data and text mining.
My use of the terms “Maghrib” and “Morocco” is guided by my sources, in particular 18th-century biographical dictionaries (ṭabaqāt). They reveal a geography of the Maghrib that is closer to the modern extent of Morocco than to a broader region spanning across North Africa. Considering, however, the anachronism of an imposition of modern notions of national identity and the border-blind aspects of environmental disasters, I situate this Maghrib in its larger, entangled world where it cannot always neatly be separated from its Ottoman neighbor.Footnote 1 Similarly, I adopt a binary distinction between “urban” and “rural” that reflects the distinction between city (al-ḥāḍira) and country (al-bādiya) in contemporary sources such as the Muhadarat (Discourses, on which more to follow) by al-Hasan al-Yusi (d. 1691).Footnote 2 Although this is an imperfect simplification of a complex landscape, it does reflect the Moroccan political situation of the 17th century, when remnant factions of the Saʿdi dynasty held on in the main cities while losing control over rural areas.
Richard Bulliet pioneered the use of intellectual history, in particular Arabic ṭabaqāt works that list biographies of scholars, as a source of environmental and social history. In his Cotton, Climate and Camels in Early Islamic Iran, Bulliet argues that a “Big Chill” caused the collapse of the cotton-based economy in Khurasan in the 12th century. This left the region vulnerable to nomadic invaders.Footnote 3 This claim, which he himself views as speculative, is too bold given the limited literary evidence and reliance on tree-ring data from remote Western Mongolia.Footnote 4 Nevertheless, Bulliet does provide useful quantitative evidence from ṭabaqāt works for the rise of the cotton industry in Iran earlier in his monograph.Footnote 5 Such a methodology should not be overlooked, considering the potential of further integrating intellectual and environmental historyFootnote 6 or of exploiting the thousands of entries in ṭabaqāt works for quantitative insights on social history.Footnote 7 My article aims to show that Bulliet’s methodology can be applied with greater precision; I do so by focusing on decades, not centuries, by using tree-ring data from the specific region under study, and by incorporating more literary evidence.
The importance of rural areas to fostering scholarship in 17th-century Morocco has been recognized by Muhammad Hajji, Justin Stearns, Gretchen Head, and others.Footnote 8 This is a welcome shift from earlier views, exemplified by Edmund Burke III, that the Morocco of this time was a “stalemate society” lacking the “radiating influence of urban civilization.”Footnote 9 Stearns states that “the knowledge production of these [rural] areas during this period, if not marginalizing urban centers, relativized their importance considerably.”Footnote 10 Neither Stearns nor Burke cites environmental disaster as an explanatory factor for these perceived changes.Footnote 11 In this article, I show that the shift to rural centers of learning was in part caused by unusually severe environmental disasters—drought and plague—disproportionately affecting the cities.
The landmark work on drought and plague in 17th-century Morocco is Bernard Rosenberger and Hamid Triki’s important study. They go so far as to argue that famine and plague played a key role in the downfall of the Saʿdi dynasty.Footnote 12 Standard works on Moroccan history, however, make little mention of the effect of plague and drought in the 17th century;Footnote 13 an exception to prove the rule is Abdallah Hammoudi’s excellent article on the zāwiya (Sufi lodge) at Tamegroute.Footnote 14 Miri Shefer-Mossensohn notes that in plague studies, too, North Africa has not received nearly as much attention as the central lands of the Arabic-speaking world, and the temporal focus has been on the medieval or the 19th century.Footnote 15 Nevertheless, as will become clear below, plague and drought were of paramount importance to Moroccan scholars and 17th-century witnesses.Footnote 16 These environmental disasters encouraged scholars to be active in rural centers of learning, a trend which in turn contributed to a shift in intellectual culture to one in which rural imagery and the Tamazight language flourished.
The Shift to Rural Scholarship
Data from Moroccan ṭabaqāt works that list scholars living (or dying) in a particular place or a particular time show that rural centers of learning became increasingly important in the 17th century. The most comprehensive Moroccan ṭabaqāt work by a scholar proximate to the 17th century is the Nashr al-Mathani (The Promulgation of the Signs) of Muhammad ibn al-Tayyib al-Qadiri (d. 1773).Footnote 17 This work is particularly useful as the obituaries are arranged chronologically by year, with a brief résumé of political, social, and environmental events for each year also included. Al-Qadiri consults a wide range of sources and includes scholars of all types.Footnote 18 I compared al-Qadiri’s Nashr al-Mathani with the ṭabaqāt of al-Hudaygi (d. 1775), who himself worked in the Afilal zāwiya southeast of Tafraout in the Anti-Atlas mountains.Footnote 19 The two are some of the earliest, most complete ṭabaqāt by scholars who lived in 18th-century Morocco and are useful for comparison, given their authors’ different geographic perspectives.
I analyzed 219 entries in al-Qadiri’s work and 155 in al-Hudaygi’s for scholars who died between the years 1001–1100/1592–1689. I coded each entry “urban,” “urban and rural” or “only rural” based on any toponyms mentioned that could indicate the places where a given scholar studied or worked (e.g., as a secretary, judge, imam, or other scholarly function).Footnote 20 I disregarded places of birth because many scholars were born in rural areas and then came to the major cities to study; to consider them “rural scholars” would skew the usefulness of my results for understanding the importance of rural and urban locales as centers of learning. Similarly, I disregarded toponym-derived nisbas (attributive surnames) as these can be inherited across generations. I did, however, consider places where scholars died as indicative of places in which they were active.
Many biographical entries do not mention any geographic location at all, and both al-Qadiri and al-Hudaygi also mention a few select scholars from outside Morocco (not included in the present study). Neither al-Qadiri nor al-Hudaygi use a specific formula to describe the careers of scholars, so the geographic information for any given scholar can vary widely. As entries for each individual year are too few to be statistically useful, I aggregated the scholars by decade, which reflects the organizational structure of al-Qadiri’s Nashr al-Mathani (al-Hudaygi’s is primarily organized alphabetically). Table 1 shows the scholars coded as “only rural” or “urban and rural” who died in each decade as a percentage of the total scholars who died in that decade.
Scholars with Activity in Rural Areas

Table 1. Long description
This bar chart shows the proportion of scholars who were active in rural areas that died in each decade of the Hijri calendar. The x-axis covers the years 1592–1688. The left y-axis (corresponding to the blue bars) is the proportion of scholars who died that were active in rural areas according to al-Qadiri. The right y-axis (corresponding to the green bars) is the proportion of scholars who died that were active in rural areas according to al-Hudaygi. Both blue and right bars show a peak between around 1631 and 1669. Before and after that, the proportion of scholars who died that were active in rural areas is lower.
This table shows that there was a move toward scholarship in rural areas preceding the years 1631–60. There are different y-axes for al-Qadiri and al-Hudaygi because they list different scholars; the ṭabaqāt of the Fez-born al-Qadiri naturally skews more toward scholars from that city, whereas al-Hudaygi’s focuses more, although not exclusively, on the scholars of the southern Sous area where he also worked. Nevertheless, both show a clear uptick in the proportion of scholars who were active in rural areas in those who died after 1631.
Less comprehensive ṭabaqāt works corroborate these findings. The compilation of scholars of al-Fihri (d. 1718) shows an increase between the beginning of the century (1602–12), when only 8 percent of death notices mention any activity in rural areas, and the latter decades (1650–89), when a consistent 13 to 16 percent of scholars who died are mentioned as having been active in rural areas. However, his work has survived with significant gaps, and the lack of sufficient data for the years 1621–50 make an analysis of overall trends through the work impossible.Footnote 21 The collection of death notices of al-Rasmuki (late 17th century), meanwhile, focuses entirely on scholars of the Sous region, making a proportional analysis of his work less useful. Nevertheless, he records no scholar as active in Fez after 1640–41, whereas several are recorded as having worked or died there before.Footnote 22 It seems that after a certain time, scholars from the Sous no longer decided to pursue their careers in Fez.Footnote 23 In addition, al-Rasmuki records more scholars active only in rural areas as dying between 1631 and 1640 than any other decade in that century, a peak that lines up with the data from al-Qadiri and al-Hudaygi.
For scholars who died in the three decades after 1631, more than about 40 percent according to al-Qadiri and 70 percent for al-Hudaygi had been active in rural areas at some stage in their careers. These high percentages are particularly notable considering Cornell’s findings that in the previous two centuries more than 66 percent of Sufi scholars “can be found to be from an urban area. By an even greater margin [the Sufi scholar] can be found to have received a significant part of his religious instruction in a town or a city, often Fez or Marrakech.”Footnote 24 Cornell only studied Sufi saints, and it is therefore significant that al-Qadiri and al-Hudaygi’s works show a significant proportion of all ʿulamaʾ as being active in rural areas in the century following the period of Cornell’s study.
Environmental Reasons for the Shift to Rural Scholarship
The standard explanation for the rise of rural centers of scholarship in 17th-century Morocco is a period of political instability. Kenneth Honerkamp argues that rural centers “offered a refuge from the strife of the towns and their dynastic conflicts.”Footnote 25 Hajji claims that “violent political tempests” in the decades following Ahmad al-Mansur’s death led scholars to abandon Fez as their intellectual capital,Footnote 26 and Francisco Rodriguez-Mañas attributes the rise of the Sufi zāwiya in the 17th century to “internecine political strife.”Footnote 27 This reflects the wider tendency to view events in 17th-century Morocco primarily through the lens of a political vacuum created by the death of the Saʿdi sultan Ahmad al-Mansur in 1603 and the subsequent disintegration of the dynasty.Footnote 28 If this were the case, one might expect a movement of scholars to rural areas soon afterward, resulting in scholars recorded as active in rural areas in the death notices of the following decades. However, as we have seen above, it is only scholars who died between 1631 and 1660 who showed a far greater degree of activity in rural areas. Assuming a life span of around sixty years or less, this represents a generation that was born toward the end of Ahmad al-Mansur’s reign (1578–1603) or after. We therefore are not looking at an exodus of scholars from urban to rural areas precipitated by the collapse of centralized Saʿdi rule, but rather a new generation of post-Mansurian scholars for whom rural centers of learning were more attractive than they were for previous generations.
I am not contending that dynastic conflicts and lack of centralized rule played no role in the increased attractiveness of rural centers of scholarship. I do, however, argue that environmental factors should be considered as a powerful explanatory factor. It should not be controversial to posit that environmental factors significantly impacted the career trajectories of scholars, considering how pertinent they were for al-Qadiri and al-Hudaygi. Both mention when scholars (or their relatives or teachers) died of plague, and al-Qadiri meticulously notes any important environmental events at the conclusion of the section for each year.
One of these environmental factors was drought. In 1607, fifty-seven years of consecutive drought set in, according to Claudine Till and Joël Guiot. They consider a year of drought as any year in which the precipitation, measured by tree rings collected throughout Morocco, falls below one standard deviation of the average precipitation level between 1100 and 1998.Footnote 29 The fifty-seven consecutive years of drought between 1607 and 1663 make up the longest stretch of drought in Morocco between 1100 and 1988 (the entirety of the period under study by Till and Guiot). In addition, that period includes four years of “severe drought” (at least two standard deviations below the average): 1613, 1625, 1631, and 1661. These scientific data are corroborated by the observations in al-Qadiri’s Nashr al-Mathani. Almost all the years in the 11th century (Hijri calendar) in which he notes rising wheat prices or hunger correspond to years of drought identified by Till and Guiot (Table 2). Drought and wheat prices are directly linked; for the year 1091 (1680–81), al-Qadiri notes that good rain caused prices to go down; whereas for the year 1094 (1683) a delay in rain caused wheat prices to go up.Footnote 30
Drought, Wheat Prices, and Hunger

Table 2. Long description
The table consists of four columns: Year (Hijri calendar), Year (Gregorian calendar), Event (Nashr al-Mathani), and Drought level (Till and Guiot).
* 1022 Hijri (1613 Gregorian): High price of wheat; Severe Drought.
* 1035 Hijri (1625 or 1626 Gregorian): High price of wheat; Severe Drought.
* 1044 Hijri (1634 or 1635 Gregorian): Delay of the rain; Severe Drought.
* 1063 Hijri (1652 or 1653 Gregorian): Hunger in Fez; Drought.
* 1071 Hijri (1660 or 1661 Gregorian): High price of wheat due to stealing; Severe Drought.
* 1073 Hijri (1662 or 1663 Gregorian): High price of wheat; Drought.
* 1083 Hijri (1672 or 1673 Gregorian): High price of wheat; No drought.
* 1088 Hijri (1677 or 1678 Gregorian): High price of wheat; No drought.
* 1091 Hijri (1680 or 1681 Gregorian): High price of wheat; Drought.
* 1094 Hijri (1683 Gregorian): Lack of rain and high price of wheat; Drought.
Other historical sources also show that, during these periods of drought, life in the large urban centers was difficult. A Jewish chronicle from Fez states that the famine of 1613–14 (precipitated by a year of severe drought according to the tree-ring data) lasted longer than previous ones, and that 7,000 Muslims in Fez died as a result.Footnote 31 The historian al-Ifrani speaks of 4,600 deaths in Fez in the first few months of 1614. Both numbers represent a significant portion of a city that had a population of about 100,000 at the time.Footnote 32 Famine conditions caused civil strife, as residents of the city, without their own land or produce to fall back on, fought over limited resources. An anecdote for the year 1650 (a year of drought according to the tree-ring data) in the Nashr al-Mathani relates,
This year a war (ḥarb) began between the residents of Old Fez and New Fez. . . . On the 23rd of the [month of] Safar, the residents of New Fez cut off the water [to the residents of Old Fez] and a great combat ensued, in which ʿAbd al-Karim al-Yarini and Muhammad ibn Sulayman died.Footnote 33
The Jewish chronicle of Fez notes that the inhabitants of Old and New Fez also pillaged each other in 1651.Footnote 34 Ayalon describes how famine caused similar urban conflict in 18th-century Damascus, including fighting over the control of bakeries and looting of granaries.Footnote 35
A further famine from 1661 onward (a year of “severe drought” according to the tree-ring data) was particularly devastating. Although the famine touched all parts of Morocco, one eyewitness account notes that it was the most severe in the cities.Footnote 36 Al-Qadiri claims that people in Fez turned to scavenging dead animals and cannibalism, and that in one-quarter of the city 670 out of 700 men (96 percent) died.Footnote 37 The generation of scholars who died between 1631 and 1660 and was far more likely to have been active in rural areas faced severe famine in the cities just when they might have moved there as adolescents to study with renowned shaykhs or to pursue their careers.
These scholars also faced the prospect of plague in the cities. Fez and Marrakesh, the intellectual and political capitals of Morocco, experienced plagues in 1605, 1606, 1625–27, 1636, 1662, and 1677–80.Footnote 38 The two cities suffered from what Varlık has termed the “capital effect,” in which large cities like Istanbul, at the center of a complex network of trade, were magnets for disease, which they imported just like people, capital, and knowledge.Footnote 39 Rosenberger and Triki estimate that the outbreak of plague between 1625 and 1627 may have killed as much as 30 percent of Morocco’s population.Footnote 40 The Jewish chronicle of Fez notes that only four or five wealthy Jews remained in the community; 650 had died within two months.Footnote 41 For the worst years of plague, al-Qadiri’s Nashr al-Mathani reports an unusually high number of scholars who died (more than one standard deviation above the average number of scholars that died per year), most of whom are coded as active in urban areas. For the years 1089–91 (1677–80), al-Qadiri explicitly mentions that the plague was the cause of death for ten scholars, nine of whom were active in the urban milieu (the other one is not associated with any geographic locale). The generation of scholars who were active in the first half of the 17th century may therefore also have considered the dangers of plague in urban centers at a time of repeated outbreaks and preferred more rural areas where contagion was slower.
Rosenberger and Tikri show that the environmental crises of the 17th century were far more catastrophic than in the preceding century; they count twenty-seven years marked by famine or plague, as opposed to eleven in the 16th century.Footnote 42 Michael Dols, too, counts more recorded instances of plague in 17th-century Morocco (as well as Tunisia and Algeria) than in the preceding or subsequent centuries, and Farid Khiari uses 150 texts from the Ottoman paşalık (jurisdiction of a pasha) of Algiers to show that the size of a family between 1601 and 1652 was almost always below average in the time period 1547–1688.Footnote 43 He attributes this depopulation to plague and famine.Footnote 44 Nükhet Varlık notes that plague outbreaks in Ottoman cities, in particular Constantinople, became increasingly frequent leading up to the 17th century.Footnote 45 In fact, the 17th century witnessed more extreme environmental events across the globe, with severe droughts happening worldwide, particularly in the 1640s.Footnote 46
Drought and plague were not isolated events, and al-Qadiri makes clear that different environmental disasters were linked with each other. He notes that in the month of Shawwal 1054 (December 1644), “whooping cough and the common cold raged, and plague followed it.”Footnote 47 In the year 1073 (1662), meanwhile, scarcity of food contributed to the eruption of epidemics (wabāʾ).Footnote 48 Ayalon notes that there were several instances in the history of the Ottoman empire when low rainfall led to food crises and therefore worse health, which then helped facilitate the spread of plague. The plague in turn led to a sudden decrease in population, and with it, a fall in agricultural production, compounding the food crisis. Such a vicious cycle occurred in Syria and Palestine between 1757 and 1764.Footnote 49
Scholars born in the first half of the 17th century may therefore have consciously chosen to pursue studies and work in rural areas to mitigate these disasters, which was then reflected in a larger number of death notices mentioning rural areas for scholars who died in the second half of the 17th century. This is notably different to the Ottoman experience of the 16th and 17th centuries, when individuals often appear to have fled to the major cities in times of famine, because under the centralized imperial provisioning system, rural provinces could face devastatingly high requisitioning demands to feed the cities.Footnote 50 In 18th-century Egypt, too, the rural peasantry sought out the grain reserves in urban areas in times of famine.Footnote 51 With rural areas in Morocco outside of the control of the remnants of the Saʿdi dynasty in the 17th century, it was rather the population of the cities who were cut off from agricultural production.
Environmental Security in Rural Areas
Rural centers of scholarship, which proliferated in the 17th century, provided distinctive environmental benefits and food security to mitigate the threats of drought and plague. A key function of Sufi lodges in Morocco had always been to provide food to the needy, which ʿAbd al-Latif al-Shadhili notes became especially important during the famines of the 17th century.Footnote 52 Some lodges were located in the mountains, with better access to water from snow melt in years of drought. J. R. McNeill has argued that a wave of deforestation in the Rif mountains in northern Morocco in the mid-17th century was the result of increasingly intensive agriculture (introduction of maize, better irrigation) that meant the inhabitants of the mountains “could produce much more food than ever before.”Footnote 53
Francisco Rodriguez-Mañas has shown that rural Sufi lodges founded around this time focused heavily on promoting agriculture and irrigation. Agricultural labor became an important aspect of Sufi practice.Footnote 54 Already during the Saʿdi dynasty many rural centers of learning were famous for their fertile environs.Footnote 55 By the 17th century, many lodges could even levy the zakat tax on livestock and crops in their surrounding areas.Footnote 56
In addition, desert areas like Tamegroute, where the famous Nasiriyya zāwiya was located, or the Draa River Valley could rely on a source of calories, hardy even in very dry conditions: dates. On the other hand, the plains of Morocco—where all major cities are located—are characterized by relatively thin layers of soil above the limestone. Little water was therefore retained in dry years, and cereal crops were easily destroyed.Footnote 57
In addition to their famine-resistance, the rural desert and mountain regions of Morocco were far less affected by plague. Plague is most contagious in warm, humid conditions; both the relative cold of the mountains and the dryness of the desert inhibited its spread.Footnote 58 More isolated communities in both areas also slowed infection.
Four important Sufi lodges particularly illustrate the environmental security offered by rural centers of learning in the 17th century: the lodges at Dilaʾ, Iligh, Jbel Ayachi, and Tamegroute.Footnote 59 In a visit to the zāwiya of Dilaʾ in August 2024, the unique environmental security offered by the lodge was clear. The zāwiya sits on a hillside overlooking the heart of the Middle Atlas mountains. The hillsides, and the valley below, were verdant even in what was a year of severe drought in Morocco, contrasting with the dry plateau on the other side of the hills to the West. As Stearns has noted, the zāwiya of Dilaʾ was protected from crop failures “due to the dense forests of the Middle Atlas and [its] flocks.”Footnote 60 The ruins of the zāwiya (an unmarked and mostly forgotten site) are surrounded by large, old olive trees and other cultivation. Within fifty meters of the remaining visible structures of the zāwiya is a mountain spring that still both provides drinking water to the local Amazigh villages and has been connected to a system of channels and hoses to provide irrigation to the cultivation on the hillside below (Figs. 1, 2).Footnote 61
The spring connected to the irrigation system on the same hillside as the zāwiya of Dilaʾ. Photograph by Ekram Karim.

The ruins of the zāwiya of Dilaʾ among the verdant hills of the Middle Atlas. According to Muhammad Hajji, the tower of bricks in the left midground are the remains of a minaret, and the square building on the right is the tomb of Abu Bakr al-Dilaʾi and his son Muhammad. Photograph by Ekram Karim.

This advantageous location allowed the zāwiya of Dilaʾ to become so large that a town sprang up around it, which even attracted a significant Jewish population, perhaps numbering in the thousands.Footnote 62 By the 1660s, the zāwiya was the most important political power in Morocco. It could support hundreds of students at a time, boasting as many as 1,400 rooms and over 2,000 manuscripts.Footnote 63
Further south, the zāwiya at Iligh in the Sous became the center of the emirate of Tazerwalt. At its height in the mid-17th century, the emirate exercised control from the Atlantic Ocean to the Tuat region in modern Algeria. Another significant center of learning was the ʿAyyashiyya zāwiya in the Middle Atlas which was founded at the foot of Jbel Ayachi (Mt. Ayachi) in 1634 by Muhammad ibn Abi Bakr al-ʿAyyashi, himself a disciple of Abu Bakr al-Dilaʾi.Footnote 64 It may be the zāwiya’s remote location and self-sufficiency that prompted a scholar residing there to note with relief that “divine grace has spared all the inhabitants of our village” from the famine of 1661/62.Footnote 65 Muhammad ibn Abi Bakr al-ʿAyyashi’s son ʿAbd Allah al-ʿAyyashi (1628–79) enthusiastically expanded the lodge’s library holdings, which grew to contain thousands of manuscripts, and was himself one of the best-known scholars of his time.Footnote 66 Likewise, the Nasiriyya zāwiya at Tamegroute is said to have amassed a collection of 50,000 manuscripts, taking advantage of its position as a terminus of the lucrative trans-Saharan trade and the concerted efforts of its leaders to purchase books.Footnote 67 Hammoudi details how the zāwiya at Tamegroute quickly became richer in the middle of the 17th century, accumulating both land and water sources, allowing its leaders to distribute food for both its students and the wider community.Footnote 68
Although the institution of the zāwiya had existed for centuries and long fulfilled the role of feeding the poor and travelers, the 17th century saw a large expansion in the political power and educational capacities of these centers. They could offer the personnel, lodging, library holdings, and environmental security to become attractive alternatives to the madrasas and study circles of the urban areas.
The Decision to Work in Rural Areas
So far, I have shown that the 17th century saw a simultaneous increase in scholars active in rural areas, unusually severe drought and plague affecting the cities, and the growing influence of rural, environmentally secure Sufi lodges. However, can these be said to be causally linked? I argue that both famine and plague affected living conditions in the cities to such an extent that scholars deliberately chose to pursue their studies or careers in rural centers of learning.
Al-Qadiri’s Nashr al-Mathani is usually silent on why scholars moved from place to place, focusing, as one might expect, on listing what each scholar studied and with whom. Yet the notice for one scholar called al-Hassan ibn Yusuf al-Zayyati (d. 1614–15) does show that moving between urban and rural spaces was sometimes an intentional decision to avoid issues plaguing the city: “When the affairs of Morocco (al-Maghrib) became unsettled and its conditions disturbed, and when misfortune became great in Fez, he left in the year 1022 (1613–14) for the Mountains of Kurt in the land of ʿAwf.”Footnote 69 Although it is not clear to what misfortune al-Qadiri is referring, Fez experienced severe drought and high wheat prices in 1613, the year the scholar left the city (Table 1). One other scholar, Ahmad ibn Abi al-Mahasin Yusuf al-Fasi, (d. 1612–13) is also recorded leaving Fez for the mountains, but this appears to have been for political reasons.Footnote 70 Definitive proof that urban scholars recognized the privileged position of rural centers of learning in times of famine can be found in al-Qadiri’s entries for the years 1063 (1652–53) and 1073 (1662), in the latter part of the fifty-seven consecutive years of drought described above. He notes that in these years famine and plague so ravaged Fez that groups of its notables (aʿyān) left to seek aid from the people of Dilaʾ.Footnote 71
The Jewish chronicle of Fez mentions only two instances in the 17th century when Jews decided to flee the city. The first happened in 1651, when a combination of combat and high levels of money demanded by the ruler from the Jewish community caused some to flee the city (no detail on the destination is given). The second example gives an explicit reason for flight to rural areas during the year 1677–78: “They fled Fez because of the epidemic that occurred that year. Most people therefore fled to the mountains and the regions that the plague had spared.”Footnote 72
In other words, plague, like drought, was a reason to leave the city for the mountains and other rural areas. Similarly, al-Hudaygi describes the case of a scholar, a certain Muhammad ibn Masʿud al-Hanzifi, who
one day . . . left the city of Taroudant with some of his family. Then he began to look around in the forest and said: these [trees] would make good housing. Those with him did not understand what he meant. Then after about three years the plague arrived, and the people left the city with their children and settled under the trees of that forest.Footnote 73
Although no date is given for this anecdote, the death of the scholar in the year 1603–4 likely means that it is describing the same desertion of the city of Taroudant related by the local scholar ʿAbd al-Rahman al-Tamanarti, who was a celebrated judge in the city for more than thirty years.Footnote 74 Al-Tamanarti writes that he returned to his place of origin—the countryside of Tamanart—because Taroudant was afflicted by plague without respite from 1597 to 1608. When he finally returned, he found the city completely empty.Footnote 75 Similarly, a Jewish source (not the above-mentioned chronicle) describes how 7,000 families, Jewish and Muslim, fled Fez because of the 1624–27 plague.Footnote 76
Many premodern Muslim scholars denied the concept of contagion based on a prophetic hadith, and some went as far as to urge people not to flee plague-afflicted cities. Sam White rightly criticizes how some modern historians have adopted this theological discourse to conclude that Muslims were fatalistic in the face of plague. In contrast, he cites diplomatic and travel accounts of the Ottoman empire during the 17th century that show how Muslim Ottoman subjects did flee plague-afflicted cities for the countryside.Footnote 77 Likewise, an Ottoman imperial decree from 1573 sought to find people who had fled an epidemic in the region between Edirne and Hasköy to return them to their homes and prevent bandits from taking over the deserted cities. Another decree from 1680 assigned a new garrison to the border fortress in Hatvan, Hungary, whose inhabitants had fled because of the plague.Footnote 78
In the Moroccan case, Yaron Ayalon notes that some 14th-century scholars in the Maghrib had already accepted the notion of contagion.Footnote 79 In the 17th century, debate continued to rage in Morocco about the existence of contagion and the religious consequences for choosing to flee or stay put in the face of plague. Al-Yusi, for one, admitted the existence of contagion.Footnote 80 In any case, the mere existence of a debate about contagion and about the permissibility to flee plague-affected areas concedes that people were fleeing cities because of the plague. Otherwise, this religious and legal debate would have been irrelevant. Sultan Ahmad al-Mansur himself wrote a letter to his son explicitly advising him to leave a plague-afflicted city as soon as possible.Footnote 81
This section has shown that scholars made conscious decisions to pursue their studies and careers in rural centers of learning because of plague and famine in the cities. Although anecdotal evidence can show scholars moving from the city to the countryside in response to environmental crises, there certainly also were many scholars who simply never moved to cities in the first place. Anecdotal evidence does not focus on explaining these non-events. It is clear, however, that the choice to study or work in rural centers of learning was a conscious decision informed by environmental factors.
The Impact of the Shift to Rural Centers of Learning
The decades analyzed here, when rural centers of scholarship increased in importance, may seem like a relatively short period of time, but activity in this rural network of scholarship had a lasting effect: an Arabic cosmopolitan scholarly culture was transformed to a Maghribi culture in which rural imagery and the Tamazight language played a greater role. Scholarship became less dominated by connected urban elites and more encompassing of rural communities and spaces. This does not mean it became inward looking or static, as implied by Burke’s characterization of a “stalemate society.” Rather, Khaled El-Rouayheb has shown that 17th-century Moroccan scholars of the rational sciences had a great impact in the eastern Islamic world.Footnote 82
Visualizing all the places that Moroccan scholars were active during the 17th century (specifically 1592–1689) according to the ṭabaqāts of al-Qadiri and al-Hudaygi is visible in heat maps showing scholarly activity across the entirety of Morocco, urban and rural (Figs. 3, 4). A poem written by al-Yusi, considered one of the most important Moroccan scholars of the 17th century, reveals a similarly broad Moroccan cartography of scholarship (Fig. 5):
Scholarly activity according to al-Qadiri. All data from al-Qadiri, Nashr al-Mathani. Map created by the author with ArcGis.

Figure 3. Long description
A geographical heat map of Morocco and surrounding regions. The data is visualized as purple, red, and yellow circular gradients indicating density.
* The primary and most intense cluster is located in North-Central Morocco, centered on the cities of Fez and Meknes, shown as a bright yellow core surrounded by red and purple.
* To the North, a secondary high-density red and purple cluster extends toward Tangier and Ceuta.
* To the West of the primary cluster, a smaller purple concentration is visible over Rabat and Casablanca.
* Moving South along the coast and inland, a significant red-core cluster is centered on Marrakech.
* Several smaller, lower-density purple clusters are scattered to the Southeast of Marrakech and toward the Atlas Mountains.
* Faint purple spots appear near Agadir in the Southwest and Bechar to the East near the Algerian border.
* The background map includes topographical features of the Atlas Mountains and labels for major cities and bodies of water like the Strait of Gibraltar.
Scholarly activity according to al-Hudaygi. All data from al-Hudaygi, Tabaqat al-Hudaygi. Map created by the author with ArcGis.

Figure 4. Long description
The heat map uses a color gradient from purple (low density) to yellow-orange (high density) to indicate scholarly activity.
* In the North, a major high-density yellow-orange core is centered over Fez and Meknes. A secondary purple plume extends North toward Tangier and Ceuta.
* Along the Atlantic coast, light purple clusters appear near Rabat and Casablanca.
* In Central Morocco, a significant high-density orange core is located at Marrakech.
* To the East of Marrakech, two smaller purple clusters are situated near the Atlas Mountains and toward Bechar.
* In the Southwest, a large elongated orange and red cluster covers the region from Agadir southward into the Souss-Massa area.
* The background includes geographical labels for the Atlas Mountains, the Moulouya River, Oum Er Rbia River, and neighboring cities like Oran, Melilla, Oujda, and Adrar.
This poem has been interpreted by Gretchen Head as corresponding geographically to a forming Moroccan national self-consciousness, because the places it evokes correspond to Morocco’s boundaries to this day.Footnote 84 Although this connection ignores the experiences of colonialism and nationalism in the intervening centuries, it is important to point out that al-Yusi makes no mention of Fez but emphasizes many of Morocco’s rural spaces. In the following pages, al-Yusi expresses in prose and verse his longing for the plains, rivers, and mountains he used to roam before he was forcefully transferred from Dilaʾ to Fez.Footnote 85 This reflects a career that took al-Yusi from Sijilmasa to Doukkala, Marrakesh, the Sous Valley, Taroudant, the remote Nasiriyya zāwiya in Tamegroute, Fez (unwillingly), and the Dilaʾi zāwiya in the Middle Atlas (Fig. 5).Footnote 86
Map of Morocco. Created by the author with ArcGis.

Figure 5. Long description
A topographical map of Morocco showing physical features and urban centers.
* Northern Region: The Gharb plain is labeled in green text along the Northwest coast. The Sebou river flows inland toward the cities of Rabat/Salé, Meknes, and Fez. To the Northeast, the Moulouya river flows toward the Mediterranean coast.
* Central Region: The Oum Er-Rbia river flows from the High Atlas mountains toward the Atlantic coast, passing the Doukkala region. The High Atlas mountain range is labeled in red text, stretching diagonally across the center. An orange triangle marks Jbel Ayachi. The city of Marrakesh is located at the foothills of the High Atlas.
* Southern and Eastern Regions: The Sous Valley and the city of Taroudant are located in the Southwest, with Iligh further South. To the East of the High Atlas, the map identifies the historical sites of Dila, Sijilmasa, and Tamegroute.
* Water bodies: The Atlantic Ocean lies to the West and the Mediterranean Sea to the North.
Al-Yusi is not the only scholar to have made full use of this geographically dispersed network of scholarship throughout his career. For example, al-Masnawi (d. 1653–54) was active in Figuig, the mountains of Ghomara, and the Sous in Morocco, and also traveled to Europe, sub-Saharan West Africa, and the great cities of the Mashriq.Footnote 87 This trajectory shows that the rural centers of learning were part of a wider, global network of scholarship.
Scholars’ literary output reflects this more geographically dispersed environment in which they were working. Text-mining of Moroccan poetry, for example, shows a shift toward more imagery related to rural areas, and a huge increase in use of the word “al-Maghrib”—Morocco.Footnote 88 The work of Moroccan poets who died before the shift to rural centers of learning (i.e., before 1631; Corpus A) shows a less frequent use of vocabulary symbolizing a rural space, such as baḥr (sea) or jabal (mountain). Meanwhile, five out of six lemmas connoting rural imagery increased in frequency in the works of poets who died after 1631 (Corpus B), whereas the term “city” (medina) decreased in frequency (Tables 3 and 4). The lemma for “Morocco” was also 448 percent more prevalent in poetry written by authors after the shift to rural centers of learning (Corpus B).Footnote 89
Lemma Frequencies in Poetic Corpora

Table 3. Long description
The table contains six columns: Lemma (in Arabic script), English translation, Category, Frequency per million in Corpus A, Frequency per million in Corpus B, and Difference in frequency.
* Morocco: Category not specified, Corpus A: 42, Corpus B: 230, Difference: 448%.
* River: Rural, Corpus A: 168, Corpus B: 626, Difference: 273%.
* Ocean: Rural, Corpus A: 546, Corpus B: 1858, Difference: 240%.
* Village: Rural, Corpus A: 84, Corpus B: 209, Difference: 149%.
* Mountain: Rural, Corpus A: 42, Corpus B: 83, Difference: 98%.
* Fez: Urban, Corpus A: 504, Corpus B: 626, Difference: 24%.
* River or valley: Rural, Corpus A: 210, Corpus B: 146, Difference: minus 30%.
* City: Urban, Corpus A: 126, Corpus B: 63, Difference: minus 50%.
* Moroccan: Category not specified, Corpus A: 84, Corpus B: 0, Difference: minus 100%.
Poets Used for Text Mining

Table 4. Long description
The table consists of three columns: an unlabeled first column for categories, Corpus A, and Corpus B.
Row 1: Poets included.
* Corpus A includes: Muhammad ibn ‘Ali al-Hawzali al-Nabigha (d. 1603), Ahmad al-Mansur (d. 1603), ‘Ali ibn Mansur al-Shayazami (d. 1603), Muhammad ibn ‘Ali al-Fishtali (d. 1612), Abu al-‘Abbas Ahmad ibn al-Qadi (d. 1616), ‘Abd al- ‘Azii al-Fisthali (d. 1621), al-Hassan bin Ahmad al-Masfiwi (d. 1622), Muhammad ibn ‘Ali al-Wujdiial-Ghamad (d. 1624), and al-Maqqarial-Tilimsani (d. 1632).
* Corpus B includes: Ibn Zakur (d. 1708), Ibn al-Tayyib al-Sharqi al-Fasi (d. 1756), and Ahmad al-Ghazzal (d. 1777).
Row 2: Total words.
* Corpus A: 23,792.
* Corpus B: 47,908.
Rural spaces were increasingly seen as part of this Maghrib. An example of this is the poetry of Ibn Zakur (d. 1708), a student of al-Yusi and considered alongside him one of the best poets of the 17th century. He idealized rural Morocco, as when he wrote,
Jacques Berque had found this imagery “glorifying the indomitable mountains” strange for a “man of Fez,” but understanding the increased cultural importance of the rural milieu demystifies the poetry.Footnote 91 Berque is far more critical of other poetry from the 17th century, claiming,
Talents oriented themselves toward forms so denuded of poetic substance like versification for its own sake or the interminable enumerations in rajaz meter, of which ʿAbd al-Raḥmān al-Fāsī is the most torrential producer. Purely didactic versification, of which neither the author nor the reader, much less the modern reader, could know how to taste the slightest charm.Footnote 92
Besides Berque’s problematic insertion of his own literary tastes, Stearns rightly argues that the proliferation of didactic rhyming verse and commentaries in the 17th century answered a need for teaching material, made accessible through the use of mnemonic devices, in rural areas where literacy was rapidly expanding.Footnote 93
The expansion of literacy in rural areas was not limited to the Arabic language. Rather, the decentralization of scholarship away from Arabic-speaking urban elites to Tamazight-speaking rural areas provided an impetus to scholarship in Tamazight languages. Nico van den Boogert identifies an explosion of scholarship in the southern Tamazight-speaking Sous region; his analysis of all the scholars in the ṭabaqāt of al-Mukhtar al-Susi (d. 1963) describing scholars from the Sous found that 114 scholars were from the 16th century, and more than three times as many (390) were from the 17th century.Footnote 94 The earliest preserved, long Tashelhit (a Tamazight language spoken in the south of Morocco) text, ʿAqaʾid al-Din (Articles of the Faith) by Ibrahim ibn ʿAbd Allah Aznag (d. 1597), dates from as early as 1590. The earliest Arabic-Tashelhit vocabulary dates to the middle of the 17th century.Footnote 95 The earliest dated manuscripts in the most important Western collection of Tamazight manuscripts also date to the 17th century. These are a copy of ʿAqaʾid al-Din by Aznag, copied in March 1680, and two works of al-Hilali: a short autograph chronicle on local history dated 1665–66 and a Berber–Arabic glossary, the Kashf al-Rumuz (The Unveiling of Signs).Footnote 96
Al-Hawzali (d. 1749) is the most important early author of Tashelhit. Born about forty kilometers southeast of Taroudant, he started studying at the Nasiriyya zāwiya in Tamegroute around 1690. There, the shaykh of the zāwiya encouraged him to write in his native Tashelhit. His most important Tashelhit work, Bahr al-Dumuʿ (The Ocean of Tears) quickly became widely cited and had “almost reached the status of a holy book” among Imazighen by the end of the 19th century. He spent the later part of his career as the head teacher at the religious school of his tribe, probably in his native village of al-Qasaba.Footnote 97
These aspects of al-Hawzali’s life resemble that of Aznag at the end of the 16th century. In the preface to one of his works, Aznag writes that “If some are not able to understand Arabic, one should read the Berber Book to the people. . . . Sidi ʿAli, son of Muhammad, has ordered us to recite the Berber Book and to explain it to anyone among the people who desires it.”Footnote 98 This Sidi ʿAli was the shaykh of a zāwiya of the Shadhili Sufi order located twenty-five kilometers to the southwest of the town of Taznakht in the foothills of the Anti-Atlas mountains.Footnote 99
The rural zāwiya played a key role in the decision of both al-Hawzali and Aznag to expand scholarship and literacy in Tashelhit, producing their own works after direct encouragement from the shaykhs of the zāwiya. Anecdotes from al-Hudaygi’s ṭabaqāt also illustrate the important role these rural centers played in expanding literacy. In his entry for the scholar Ahmad ibn Muhammad ibn Nasir (born 1647/48), al-Hudaygi writes that Nasir founded several zāwiyas in the Draa River valley on the edge of the Sahara, in far Southeastern Morocco:
He established the zāwiya to uphold God’s religion and provide food. Delegations of Arabs and Imazighen would crowd around him, and the poor and destitute, and those seeking knowledge and the nearby scholars, teachers, and worshippers would seek shelter with him with their families and children, eating and drinking by the grace of God Almighty in countless numbers.Footnote 100
This anecdote of a zāwiya harboring local scholars contrasts with a story al-Hudaygi relates about an Amazigh scholar named al-Hassan ibn Muhammad al-Sawabi (d. 1602) trying to make it in Marrakesh at the time of the Saʿdi dynasty. As soon as he arrived in Marrakesh to study, “he saw the students discoursing with each other and could not speak eloquently with them.” His anxiety increased until his mother counseled him in a dream to perform a ziyāra (visitation) to the tomb of a certain shaykh, after which “God set his tongue free.”Footnote 101 In this anecdote from Saʿdi times, lack of familiarity with Arabic is much more of an obstacle to a scholarly life than it was later, in the 17th century.
Drought and plague were prominent reasons for the shifting institutional landscapes that caused these kinds of changes in the intellectual culture. Similarly, Hussain has argued that the shifting course of the Euphrates in the 18th century profited the Shiʿi shrine cities of Najaf and Karbala and thereby accelerated the conversion to Shiʿism.Footnote 102
Conclusion
Rosenberger and Triki argue that “the importance of food crises or epidemics as an explanatory factor is obvious: in this way the weakening of the dynasty after the death of al-Mansur is better understood through the demographic, economic, and social crisis than only through the conflicts of the pretendants, his sons.”Footnote 103 In the five decades since publication of that article, however, famine and plague have largely been ignored. In this article, I have argued that unusually severe famine and plague in the early 17th century can at least partially explain a noticeable shift in which Moroccan scholars turned increasingly to rural institutions of learning. The ṭabaqāt works of al-Qadiri and al-Hudaygi quantitatively show that such a shift occurred in the first half of the 17th century. The early 17th century coincided with long periods of consecutive drought and repeated outbreaks of plague, which the sources describe as especially severe in the cities. Meanwhile, rural centers of learning offered a degree of environmental security. Anecdotes of scholars and communities fleeing famine- or plague-stricken cities show that the move to rural learning was a deliberate response to environmental crises, not a coincidence. This shift led to cultural changes reflected in choices of literary style and the increase in Tamazight-language scholarship. To return to Edmund Burke III a last time, I suggest that the unusually disastrous environmental challenges of the early 17th century played a significant role in the changing place of the rural in Moroccan culture that he himself observed: “By 1650 the essential traits of early modern Morocco had come together to form a new and precarious balance between rural, popular culture and the higher urban culture represented ideally by the ulama.”Footnote 104 Understanding exactly what this intellectual culture looked like and what made it distinct deserves further study. In addition to showing the impact environmental factors can have on intellectual culture, I have also endeavored to show that a methodology integrating literary evidence, scientific data, and quantitative analysis of ṭabaqāt works can provide valuable insights into the social history of Morocco.
Acknowledgments
For their valuable feedback on this project, I would like to thank Alan Mikhail, Shawkat Toorawa, Kevin van Bladel, and the anonymous reviewers.

