A madrasa (madrasah in Arabic or medrese in Turkish) is a secular institution of education, although often with a religious component. Madrasas would specialize in medicine, law, science, philosophy, religion or the education of (horrors) women. Others also taught logic, world history, foreign languages, mathematics, art, and comparative literature. The first madrasa, the Gama'at al-Qarawiyyn, was established in 859 AD by Fatimah al-Fihri, the daughter of a wealthy merchant. During the rule of the Fatimid, Ayyubid, and Mamluk dynasties, the practice of sponsoring madrasas by the ruling, wealthy elite spread across Egypt and the Middle East. The first Ottoman madrasa was founded in 1331 in Iznik, and followed the traditions of Sunni Islam. The madrasas of the Turks and Arabs would, as Europe stumbled through the Dark Ages, keep the best of Western knowledge alive, and blend it with that of the East.