The complex is composed of various buildings built in different eras. The church was built by the Byzantine Emperor Theodosius II in 446. During the Seljuks of Anatolia era Seljuk governor Nasretüddin built a mosque, a caravanserai and a fortified barracks between 1215 and 1233. Later, during the Beylik of Dulkadir era a medrese (religious school) in 1480-1492 was added to the complex by Bozkurt of Dulkadir (also known as "Alaüddevle"). In 1500 Bozkurt's wife Şemsi Hatun commissioned a women's mosque. A pergola for the governor known as Paşa çardağı was the addition during the Suleiman the Magnificent's reign of the Ottoman era.
The külliye is known as the cave of the Seven Sleepers, a legendary people lived in the 5th century. (One of the many places which are allegedly the cave of Seven Sleepers) According to the legend the emperor who had influenced by their story had the church built for them. But the later additions are also imposing. For example, the geometric ornaments on the gate which was built during the Seljuks period cast shadows of a praying man, a praying woman and a dervish in namaz (salah) times.