The mosque once included a madrasa (an educational institution), an imaret (a public soup kitchen), a market, a primary school, tombs for the royal family and a Muvakkithane, a time house for astronomers to make of calculations of the correct time of the prayers.