This ended Cairo's status as an exclusive palace-city and started a process by which the city became an economic center inhabited by ordinary Egyptians and frequented by foreign travelers.[1] The old Fatimid palaces in the city became obsolete as caliphal residences and were opened up to redevelopment. Salah ad-Din initially transformed them into residences for the aristocracy of his own Ayyubid dynasty, as well as into madrasas, a khanqah, and a hospital.[10]: 51 The Ayyubid sultans al-Kamil and al-Salih built important madrasas in different areas of the site of the former palaces. In the Mamluk period the transformation of the area continued and most of the palaces disappeared and were replaced with various urban structures, and transformed into new city neighbourhoods.