[7] Up until the Bulgarian occupation of Komotini during World War II five madrasas were known to exist, but today the Hayriyye is one of the two to survive in the whole of Western Thrace, the other being one in Xanthi.
The Ottoman madrasa was built in 1730 (1142 in hijri years, as evidence by an Ottoman inscription written at the entrance of the Mosque) by Hadji Zekeriya Efendi and included the Islamic school, the Kayali Mosque and student accommodation cells.
[11] A fountain stands in the inner courtyard of the madrasa, built by Debağ Hadji Ibrahim and dating to 1819 according to the Ottoman inscription on it.
Subsequently, and until very recently, teachers were appointed among those who attended the Special Pedagogical Academy of Thessaloniki (to which only minority children had access[15]), the vast majority of whose students were graduates of the Hayriyye Madrasa (whether in Komotini or Echinus).
In the years 2000-2001 girls were also enrolled and thus the two schools ceased to serve the purpose of their original establishment, which was the training of priests of the Islamic faith.
It publishes the religious course books itself that are required during teaching and supplies the corresponding school in Echinus with them as well.
In December 2018 students of Hayriyye Madrasa abstained from lessons and even barricaded themselves in the school in order to protest the law that would limit religious and Turkish language courses; Greek media was criticised for not covered the subject.