This is a typical monastery from the Byzantine era, built at the beginning of the 12th century by the wife of the Byzantine emperor, Irena of Hungary. When another church was built nearby, both shrines were connected by a chapel, thus creating the Monastery of the Pantocrator. It is the second largest Byzantine religious structure after Hagia Sophia, still standing in Istanbul. Originally, the complex contained a fifty-bed hospital, medical school, pharmacy, and library. After the conquest of Constantinople in 1453, Sultan Mohmed II transformed the monastery into the first Ottoman educational institution in Istanbul. Finally Eastern orthodox monastery was transformed into a Zeyrek Mosque.