Madrasah is an Arabic word which means "school". However, in the present context a madrasah means an Islamic Religious school.
Historically, the madrasah started like other forms of Islamic education; the learning of the Quran and Hadith from individual ulama or the studies of Islam conducted in mosques. Its main purpose was to educate an individual on Islamic religion or various aspects of the religion. In many mosques there were space such as halls and annexes which were used for classes as well as residence for students and teachers.
Separate institutions for higher studies sited away from mosques did not come into being until the 10th century C.E. (Common Era). Studies after the creation of madrasahs as separate institutions, in many cases the mosque itself was still used for the purpose of teaching. Moreover, every great mosque built by the Muslim rulers had a full-fledged madrasah attached to it.
The Western powers introduced their own concept of education in their colonies which resulted in the establishment of dual education system - secular and religious. This dual system replaced the unitary Islamic system of education.