Madrasa, an Arabic word, taken from darasa, means a place where dars (lesson) is taught. Today, madreses are intended for children before they go to university and include schools where multiple kinds of lessons are taught. Medieval schools dedicated to religious studies were called madarsas. They have similarities with the scholastic schools of medieval Europe and its main figure, Thomas Aquinas. Scholasticism was a method of critical thought that dominated teaching by academics of medieval universities in Europe from about 1100 to 1700.
The establishment of Madrasa in medieval Iran began in the mid 11th century with the dominance of the Saljuqs in Iran and Baghdad, where the Abbasids were originally stationed. By providing a brief introduction to transformations in educational institutions from pre-Islamic Iran to the early 11th century, this study intends to examine the functions and structures of several types of madrasa in Iran and Baghdad under the Saljuqs (1037-1194).
There were two main centers of education in pre-Islamic Iran. The first was Agora, an open place of assembly in the city where military techniques and religious issues were taught. Agora is actually a Greek word meaning an open place of assembly. It was a designated area in the city where freeborn citizens could gather to hear civic announcements, prepare for military campaigns or discuss politics. As a result, it relied on so-called atashkada fireplaces and was administered by Zoroastrian priests. A second type of school was built by the Sassanians to educate princes and nobles. The most prominent was the Academy of Gondishāpur located in southwestern Iran in the village of Shah Abad near Shushtar. (Gondishāpur in Pahlavi wah andi Shāpur) means “Shāpur city is better than Antioch” and was built by Shāpur the First (240-270). This academy of learning was an intellectual center for philosophy, theology and science under the Sasanian Empire. Adjacent to an enormous hospital, it offered training in medicine during the 6th and 7th centuries, especially under Anushirwān (531-579). Historians such as Ibn Howqal (976), Yāqut Hamawi (1228), Ibn Athir (1340), and Ibn Khaldun (d.1406) pointed to the vast educational programs of Gondishāpur and their continuity in time.
Unfortunately, nothing specific has remained of the Academy of Gondishāpur, nor do any sources refer to the functional and structural architecture of this educational center. Scholars such as Dr. Sami’i Azar in History of Development of Schools in Iran, however, hypothesize that the architecture of the Academy of Gondishāpur must be similar to the palace of Bishāpur built by Shāpur.
Unfortunately, nothing specific has remained of the Academy of Gondishāpur, nor do any sources refer to the functional and structural architecture of this educational center. Scholars such as Dr. Sami’i Azar in History of Development of Schools in Iran, however, hypothesize that the architecture of the Academy of Gondishāpur must be similar to the palace of Bishāpur built by Shāpur the first . In the Bishāpur Palace, the central space is a square courtyard covered by a domed chamber (gonbadkhāna) and is surrounded by side rooms. Access to these side rooms is possible from the central area, a square chamber with a dome called gonbadkhāna. Other spaces are arranged relative to gonbadkhāna. The space is surrounded by two symmetrical ivān, one of which is connected to the entrance.
The second feature is the use of two types of spaces in the plan. First there are long ivāns and long vaults called Tāq-āhang, and second there is a gonbadkhāna. Unlike ivāns which were intended to link spaces and dālāns (passages), gonbadkhāna were discreet and independent spaces intended for specific functions. The structure of gonbadkhāna was capable of holding educational functions. Later, these features, as well as philosophical and scientific achievements, were passed on to Islamic educational centers including the madrasa.
Islam rose in Arabia, which was largely based on a nomadic way of life. For that reason, they did not need to develop social edifices, including educational centers. However, the rise of Islam meant fundamental changes to the education systems of this region. Arabia, where education was based on oral traditions, became a center for the teaching of the Quran, the holy book of Muslims. Islamic society, then, gradually needed to draw on written traditions. In addition, it intertwined education with religious studies. Mosques were the first centers where the Quran and later the Hadith were taught. Mohammad had said: “Everybody who enters mosques to learn or to educate others is doing Jihad.” It was Mohammad and later pious Caliphs who conducted political and social affairs from the mosques.
As a result of the structure of Iranian mosques in the first two centuries, people were able to practice Islamic traditions in Sassanian architecture. These Sassanian features include ivān and gonbadkhāna. In the first place, the Ivān changed from a space of passage to a space for praying or for jalasat-e dars (learning sessions). In the second, gonbadkhāna either as a large square room or a series of continuous Chārtāqi were used as a shabestān facing the Qibla for prayer or for giving religious sermons.
Moslem’s needs for Mosques in the conquered territories meant that many atashkada (fireplaces) were transformed into mosques. Masjed-i Tārikhāna in Dāmghān is a good example of these mosques. Tārikhāna (the house of God) located to the south-east of Dāmghān was constructed in the 9th century. It was built in a pre-Islamic khorāsani architectural style, which was common in the 11th. In the Sassanian style, the ceilings were free of walls, supported only by cylinders. This type of mosque is called “chehel sotun” (forty columns) because of the concentration of its column .The tall columns and Chārtāqi of Tārikhāna Mosque were built in the style of “Chārtāqi” which illustrated Sassanian characteristics.
By emphasizing holiness, Tārikhāna maintained its architecturally compatible design. Places of worship in religions like Zoroastrianism and Islam were highly honored. By accepting the hypothesis that Tārikhāna was originally a “fireplace”, it maintained its religious and social functions as a place of worship. On the other hand, the sanctity of kings in Iranian culture and their farah-e izadi (divine splendor) gave them special dignity. In many historic and literal sources, the word khodā refers only to kings. Due to the hypothesis that Tārikhāna mosque was already a Sassanian palace, and mosques are often built on sacred places, the mosque has consistently maintained its dignity throughout its history. Tārikhāna, as well as Masjed Jami’s of Bukhara, Nā’in and Qazvin are all good examples of mosques dedicated to prayer and have no spaces dedicated to education.
From the early 9th century, education changed from merely learning the Quran to the spread of Islamic schools. Education and praying spaces in Islamic society were impacted by the division between two groups of Sunnites, such as Shafi'i, Hanafi, Maliki and Hanbali. Furthermore, there are Shiites such as Zaydis, Ismailis, and Imamis. Mosques, particularly the Masajid-i Jami’ (congregational mosques) became the centers of these various ideas. There were fundamental changes in the educational system due to the existence of different perspectives and the spread of these ideas into society. The education of these thoughts and attempts to establish them in society as opposed to alternative ideas became one of the top priorities of mosques.
Congregational mosques of the 9th century are good examples of masjed-madresa. This new function inevitably affected the physical plan of the mosques to facilitate education through seminars, work-groups and lectures.
From this time on, education influenced the architecture of mosques in two distinct ways. First, mosques became considerably larger and with broader spaces. Second, the single ivān plan of mosques like Tārikhāna, Masjed-e ‘Atiq of Shiraz and Masjed of Nāien became four ivān mosques. (pic) The four ivān provided a vast space for education. In this plan, it was easier for the lecturer to have eye-contact with his audience and to hear what they said. Moreover, different schools of thought could have an Ivān for themselves. Masjed Jami’ of Zawāra and Masjed Jami’ of Ardestān are good examples of these masjed-madresa.
Masjid of Naien
Masjid Jami’ of Zavareh
Masjid Jami’ of Ardestan
Masjed-Jami’ of Esfahān, however, is thought to be the foremost example of these types of masjed-madrasa manifesting the beauty and originality of Iranian architecture. It includes 20 different buildings. The mosque is the result of continual construction, reconstruction, additions and renovations on the site from about the 8th to the end of the 20th century. There are hypotheses that this Masjed had originally been an atashkada so, like the first Iranian mosques, it was built around a central courtyard surrounded by four ivāns. Construction under the Saljuqs included the addition of two brick gonbadkhāna, for which the mosque is renowned. The south dome was built to house the mihrab in 1086–87 by Nezām al-Molk, the famous vizier of the Saljuqs, and was larger than any dome known at its time. The north dome was constructed a year later by Taj al-Molk Nezām al-Molk's rival.
Masjed-Jami’ of Esfahān
There are several theories as to the educational uses of Mosques. Some scholars like Sauvaget (1947), the famous orientalist, in his Book La Mosque Omuyyade de Madina”, hypothesize that Masjed Jami’ of Ardestān, Qazvin, Ray and Baghdad were basically Madrasa. This theory seems unlikely for two reasons. The first is the absence of any other places in these cities that could be considered congregational mosques, since this was a basic necessity of these cities. The second reason is that the establishment of the madresa was a result of the conflict between religious and educational affairs. Therefore, it is unlikely that these congregational mosques were Madarasa.
Hillenbrand (1994) in Islamic Architecture, on the other hand, has another theory. He believes that some masjed-madresa such as the ones in Ardestān, Qazvin, Esfahān and Baghdad were basically madresa which were constructed within the mosques and were intended not to disturb any other functions of mosques. Students lived in two-floor ravāq that were built around a courtyard. Rooms that were built behind these two-floor ravāq support this theory.
Under the Buyids and Ghaznavids, besides mosques where public studies were conducted, other buildings were built intended for more private studies. Some examples of these types of buildings are: 1. maktabkhana where primary education including reading the Quran and writing was taught. 2. Dār AL-ELm, Beyt al-Hekma and the library were private institutions built by governors or Ulama. These buildings which were intended for particular people did not have a large impact on the physical structure of educational centers.
In the early 10th century masjed-madrasa were not able to fulfill the educational needs of society, so the establishment of an independent educational institution became necessary and those were madrasa. Clashes of ideas among different sects of Sunni and Shiite were one of the main reasons for the establishment of madrasa. The Fatemid dynasty came to power in the 10th century, with their emphasis on Shiite ideas in Egypt. Al-Azhar was founded in 970 and from its early beginnings evolved into the religious and political center of the Fatimids. From their center in Al-Azhar, the Fatimids made many efforts to spread the Fatimid religion, or the Sevener religion, to the entire Islamic territories in Baghdad and Iran. Isma'ili developed in Iran and became established in the castles of central and eastern Iran as a result of these ideas.
Iranian bureaucrats, particularly Nezām al-Molk, established Sunni Islam in Iran and Mesopotamia in opposition to the Fatemids as well as to the Shiite Buyids who ruled Iran and Baghdad for over a century and so dominated the Abbasids as the main center of Sunni Islam. Establishing educational centers that could compete with Al-Azhar was therefore uniquely significant. Under these conditions, madreses were no longer able to transmit these ideas.
The contradictions between the religious and educational functions of the masjed-madrasa had resulted in problems regarding the proper use of the structures of the buildings. In addition to the conflict between the Shiite and Sunni sects, each had its own schools that identified themselves as true Islam at the time. Consequently, mosques were no longer proper places for these arguments and disputes, as they interfered with the peace and spirituality of mosques.
Masjed-madrasa attracted many students from other cities, even though they didn’t have facilities for them to live. In addition, the Saljuqs’ direct supervision of educational centers was not in line with the structure of mosques. They also controlled the development of the content of teaching materials and the independent position of modarres, the teachers from Imām-e Jamā’at which required a distinguished place for them.
But these social changes required factors such as long-term social and political stability and the support of power from this movement. Sporadic activities were accomplished in the 9th and 10th centuries, but it was under the Saljuqs that a comprehensive dynasty was developed in Iran. This dynasty spread its power to Baghdad, where the Abbasid Caliph was stationed. This political stability provided the conditions for powerful social changes under the guidance of influential Iranian viziers. In his relatively long vizierate, Khwaja Nezām al-Molk, the strong Saljuq Vizier of Alb Arsalān (1063-1072) and Malekshāh (1072-1092), marked a turning point.
The establishment of Nezāmiyas was the most significant educational development in Islamic medieval history. These madresas were formal governmental schools in Sunni Islamic territories which represented an independent educational center. By establishing governmental schools in the form of Nezāmiya, Nezām al-Molk achieved fundamental changes in the viewpoint of education. The expenses of these schools were listed in government budgets, and the schools advertised and taught official religious beliefs.
Nezāmiya were consciously built in the large cities of the Saljuq territories, which highlights their significant role within the political structure of the Saljuqs. Nezāmiya were built primarily in the center of provinces to attract students from smaller cities. The point that about 30,000 people attended Mohammad Ghazali’s lecture may be exaggerated. However, it does point to the vastness of these buildings.
The large number of Nezāmiya which were established in a relatively short period of time in cities of Iran illustrate that they were constructed based on a shared plan. This standard plan was intended by Nezām al-Molk to provide a single political-religious result. It supports the theory that these schools were architecturally built with a uniform structure. This was to provide a common picture of Sunni madresa in contrast to the Shiite centers of education. Nezāmiya initiated the project to have a residence and dining hall for students. The purpose was to provide welfare for students so that they could focus on their education. Therefore, the plan of the madresa changed from a building similar to a mosque to a building like Cārvānsarāi.
Cārvānsarāi of Sharaf
Based on their waqfnāma ( a document about endowment under Islamic Law), Nezāmiya were dedicated to Shafi’s and had specialized staff members such as Motavalli (trustees), Nāzer (supervisors), Khāzan al-Maktaba (Librarians), and bovvāb (Doormen). Teachers were employed after they passed through a very strict process of application and were required to have permission to teach. It was necessary for ostād (teachers) to wear tarha (specific clothing) and to sit on specific chairs.
During the teaching, two assistant teachers (mo'ids) stood by ostād and repeated what he said. In his absence, Nā’eb taught the lesson. The library of the madresa provided the ostād with their required books.
According to Hāfiz Abru, on one occasion, Alb Arsalān arrived at Neishāpur. The mosque was surrounded by some Faqih. The Sultan asked, “Who are they?” Nezām al-Molk said, “They are ulama, the finest of people since they have left the mortal world to gain virtues and perfection of the soul." The Sultan was impressed. Nezām al-Molk offered to build a place for this group of people in each city and designate fellowship for them, so they could spend their time on education and prayer for the continuity of the Sultan's reign. The Sultan approved the plan, so Nezām al-Molk wrote orders to construct schools in other cities. It is believed that seventy schools were built with the Sultan's wealth. According to Zobdat al-Tawārikh, Nezām al-Molk was the first person who founded this tradition. 
According to Sobki in Tabaqāt-e Shāfi’, Nezām al-Molk had built Nezāmiya in every city of Iraq and Khorāsān. Hendu Shah Nakhjawāni in Tajarib al-Salaf mentions that Khwaja built madrasa in Baghdad, Basra, Esfahān, Harāt and Rome (Tajarib al-Salaf, 269). Subki is the only biographer who refers to Nezāmiya in nine cities of Baghdad Balkh, Neishāpur, Esfahān, Basra, Marv, Amul, Tabaristan, Mosul, and Harāt”.
Now we examine some of the main Nezāmiya
Nezāmiya of Neishāpur:
With respect to the number of Modarres, Fuqaha (Jurists), and students, Nezāmiya of Neishāpur was the second Nezāmiya after Nezāmiya of Baghdad. Sources do not cite when it was built. However, based on historical evidence, it was evidently built before Naizamiya of Baghdad and during the reign of Alp Arsalān. During this time, with the murder of Amid al-Molk (d. 1064) the first vizier of Alp Arsalān who believed in Hanafi, the Shafi’ supported by Nezām al-Molk flourished. In Neishāpur, he assigned prominent Shafi' Ulama such as Imam al-Haramein Khovayni and Imam Mohammad Qazāli as trustees and teachers.
Very little is known about the architectural features of this madrasa. Sobki only mention that Abul Hasan Kiyāhersi (504), the famous student and assistant of Imama al-Haram Jovayni was “Kathir al-La’n” (was cursing a lot) and while going up the stairs of madrasa, he cursed Satan 70 times on each of the 70 stairs. So, it illustrates that the madrasa were similar to large congress halls.
But why was the Nezāmiya of Neishāpur not as famous as Baghdad’s. Many reasons have been suggested. First Nezām al-Molk paid more attention to the madrasa of Baghdad to highlight it against al-Azhar, which was the main Shi’i madrasa in that time.
Second, the devastating invasions of Qoz and then the Mongols of Neishāpur destroyed these schools, although the Mongol invasion of Baghdad was not as devastating. In addition, Baghdad and its famous schools like Nezāmiya and Mostanseria flourished again under Ata Malek Jovayni.
Nezāmiya of Baghdad
This was the most significant madrasa of Nezāmiya (founded in 1066). According to Montazam by Ibn Jowzi It was built in the eastern part of Baghdad on the bank of the Tigris and in the Bazar Soq al-Salāsa near the gate Bab al-Azaj next to Madrasa of Marjān. After the establishment of Nezāmiya in Baghdad and with the use of its standard pattern, other schools were constructed in Balkh, Ray, Esfahān, Basra, and Khargerd. Nezāmiya of Baghdad was established on the bank of Tigris River and in the Bazar of Baghdad. The construction of the madrasa cost 60000 dinars and Khwaja dedicated annually 15000 dinars for the expenses of students. Several buildings including a bathhouse and shops were constructed around the school. Many of these shops and properties of Bazar were bought to pay for the expenses of the school (Waqf: an Endowment under Islamic Law) (8:238). Historical resources such as Al-Kāmel fi al-Tārikh emphasize the beauty of the brickwork as well as the tile decorations of the ivān of Nezāmiya.
Ibn Jobayr Andulosi in Rehlat Ibn Jobayr who visited the mosque in late 12th century mentioned that it had been reconstructed in 1184 and was the most beautiful among the 30 schools of Baghdad (215-216). Even Ibn Batuta, who visited the madrasa in 1328 described it as a uniquely prominent building in the Islamic world. (Ibn Batuta, 217).
It included vast spaces, large ivāns for the residence of Foqahā and Ulama, the mosque, the stand for the Mo’azzen, a library, and storage for food and other necessities. According to al-Most’azam most settled areas and eastern houses of Baghdad on the bank of the Tigris in the district known as “Moshrat al-Zawāyā” and “Darb-e al-Za’farāni” were destroyed. Even though Nezām al-Molk spent a great deal of money to purchase these properties. According to Bedāya wa Nahāya by Ibn Athir, their owners reluctantly sold them, and because of that Shaykh Abu al-Ishāq Shirāzi, the ostād (teacher) of the madrasa at first refused to teach at this school (Bedaya, 12: 96). Based on Wafiyat al-A’yan, Ibn Khalakān when Imam Mohammad Qazāli arrived at the madrasa for the first time, about 30000 people crowded into the building including the courtyard, Ravāq, stall and roofs, so that illustrates the fact that it must have been an extremely large building. Sa’di was one of the most prominent students in the Nezāmiya of Baghdad:
Nezāmiya of Esfahān:
This Nezāmiya is also called Sadriya because of the title of the Khojandi family (named Sadr al-Din) who taught there. After them, it was called Sadriya. It is not known when it was built, but based on the ketab-i Mahasen al-Esfahān by Māforoukhi, it must have been built between 1073 and 1093. Nāemiya was located in Dardasht, one of the main districts of Esfahān.
“Nizām al-Molk” ordered the madrasa to be built next to Jami’ for Shafe’i Foqahā” (Mahasin-Esfahān, 104). Mohammad ibn Sābet Khojandi was one of the main teachers of this madrasa.
Hossein ibn Mohammad Āvi, the translator of the Mahasin Esfahān in 1329 describes Nezāmiya. “Khwaja established the Nezāmiya of Esfahān near the mighty Jami’ in the district Dardasht, as the most impressive structure, with the finest features and materials available, and in the best location. At the entrance, there is a giant tall minaret like a tower touching the sky. Three people can go up into the minaret through its spiral base, and they can’t even see each other as long as they haven’t reached its kongra. A lot of money has been spent on it and a lot of Ziya’ (land) has been dedicated (Waqf) to this madrasa which cost over 10000 dinars. Yet now they are owned by Mostakala (freeloaders)” (Mahasin-i Esfahān, 142).
Nezāmiya of Khargerd
Khargerd was built in Khwāf, a vast area near Neishāpur in Khorāsān. It consists of 200 villages and three major cities: Sanjān, Sirvand and Khargerd. Abu al-Muzaffar Khwāfi was one of the main Ulama of this city.
The ruins of a Saljuq building in Khargerd are most likely a madrasa that is the only remnant of the Nezāmiya madrasa. This building was built during the time of Khwaja Niza Molk, according to an inscription. As one can see from this plan, it has both a square courtyard and four ivān.
This building is not very large, so it cannot be a mosque. Moreover, the presence of numerous windows disproves any theory that it may be a mosque.
A historical study of the madrasa as one of the main social buildings opens a window onto the darker aspects of medieval history. The Saljuq, as a major actor in this chapter of medieval history, made dramatic changes in the structure and functions of architecture. The establishment of the Nezāmiya was a critical change in educational space. Iranian pre-Islamic elements of both Ivān and Gonbad were used in the structures of masjed, Masjed-Madrasa and especially Madrasa in order to provide an exclusive place for education. These features were later used in the Nezāmiya and became the basis of other madreses in later times.
 . Alireza Sami’ Azar. Tarikh-e Tahavvol-e Madares-e Iran, Tehran: Moassesey-e Tose-e va Tajhiz-e Madares-e Iran.
. «مَنْ دَخَلَ مَسْجِدَنَا هَذَا، لیَتَعَلَّمَ خَیْرًا أَوْ لیعَلِّمَهُ، کَانَ کَالْمُجَاهِدِ فِی سَبِیلِ اللَّه؛ هرکسی برای تعلیم یا تعلّم وارد مسجد شود، همچون مجاهد در راه خداست».Mostadrek al-Vasayel, Vol. 1, pp 166 and 227..
 . Mohammad Karim Pirniā. 2005. Tahqiq dar Gozashte-ye Me’māri-ye Iran, ed. Qolāmhossein Me’māriān, Tehran: Sorush’e Dānesh, p. 134.
 . Sauvaget, Jean. 1947. La Mosquee omeyyade de Médine, étude sur les origines architecturales de la mosquee et de la basilique. Paris: Van Oest.
 . Hillenbrand, Robert, 1994. Islamic Architecture: Form, Function, Meaning, New York: Columbia University Press.
 . See Hāfez Abru. 1993, Zobdat al-Tawārikh, ed. Kamal Hājseyyed Javādi, Tehran: Ney.
 . See Tāj al-Din Sobki. 1918. Tabaqāt al-Shāfe’iyat al-Kobrā, ed. Mohmud al-Mohammad Tayāhi, Qairo: Dār al-Ahyā’.