The mausoleum is located on the southwest side of the former Dar al-Kebira Palace, in a space that was formerly between the inner and outer perimeter walls of the palace.[4] Moulay Isma'il chose this location in part because it was already considered sanctified by the presence of the tomb of Sidi 'Abd ar-Rahman al-Majdub, a 16th-century poet and Sufi mystic.[4][10] The complex was first built in 1703[11][12]:48 under Moulay Isma'il, but was modified and expanded multiple times, in particular under his son and brief successor, Ahmad ad-Dhahabi (who ruled, with interruptions, between 1727 and 1729), who was in turn buried here afterwards.[4][13]:270 Sultan Moulay Abd ar-Rahman, who died in 1859, was also buried here later.[13]:270