The origin of this type of institution is widely credited to Nizam al-Mulk, a vizier under the Seljuks in the 11th century, who was responsible for building the first network of official madrasas in Iran, Mesopotamia, and Khorasan.
In an architectural and historical context, the term generally refers to a particular kind of institution in the historic Muslim world which primarily taught Islamic law and jurisprudence ( fiqh), as well as other subjects on occasion. In countries outside the Arab world, the word usually refers to a specific type of religious school or college for the study of the religion of Islam, though this may not be the only subject studied. The word is variously transliterated Madrasah arifah, medresa, madrassa, madraza, medrese, etc. مدارس, madāris) is the Arabic word for any type of educational institution, secular or religious (of any religion), whether for elementary education or higher learning.