An Islamic theological and legal college. At first instruction was given in mosques (e.g. al-Azhar, Cairo, still an intellectual centre). The first residential madrasas were built in Iran in the early C10, probably similar to Buddhist VIHARAS in Central Asia. None survives. A madrasa has a courtyard with an IWAN, serving as a classroom, on at least one side, a prayer hall and accommodation for teachers and cells for students, seldom more than twenty.