 The north portal of the mosque gives the date of 626 AH (1228-9) and the name of its patron as Ahmadshāh b. Sulaymān, who is one of the rulers of the Divriği branch of the Mengujekids.The inscription on the portal of the hospital describes the building as a "dār al-shifā"' ("house of healing") and ascribes its foundation to Tūrān Malik bint ("daughter of") Fakhr al-Dīn Bahramshāh.Fakhr al-Dīn Bahramshāh is the best known Mengujekid ruler whose reign, in Erzincan, lasted for nearly sixty years until his death in 1225.