Madrasa al-Ashrafiyya

The Madrasa al-Ashrafiyya (مدرسة الأشرفية) is an Islamic madrasa structure built in 1480–1482 by the Mamluk sultan al-Ashraf Qaytbay (after whom it is named) on the western side of the Haram al-Sharif (Temple Mount) in Jerusalem. Although only a part of the original structure still stands today, it is a notable example of royal Mamluk architecture in Jerusalem.

History
A first madrasa on the same site as the Madrasa al-Ashrafiyya was begun by Sultan Khushqadam in 1465. The current madrasa, however, was completely rebuilt by one of his successors, Sultan al-Ashraf Qaytbay, after whom it is named.

Al-Ashraf Qaytbay was one of the last powerful and successful sultans of the Mamluk Empire which ruled from Cairo, Egypt. He was originally a mamluk purchased by Sultan al-Ashraf Barsbay (ruled 1422–1438) and served under several Mamluk sultans. Qaytbay succeeded Timurbugha as sultan at the age of 54, and ruled for nearly 29 years from 1468 to 1496, the second-longest reign of any Mamluk sultan (after al-Nasir Muhammad). Despite rebellions and other challenges, he is known as an effective ruler who brought long-term stability while he remained in power, and is especially notable as one of the greatest patrons of architecture in the Mamluk period, and particularly of the Burji Mamluk period which was otherwise marked by Egypt's relative decline. He is known for at least 85 structures which he built or restored in Egypt, Syria, Palestine, and Mecca, including 17 in Cairo, and this period is characterized by a refinement of the Mamluk architectural style.

Qaytbay saw Khushqadam's madrasa in 1475 and apparently did not think highly of it. In 1478 CE (883 AH), he endowed a quarter of the revenues of Mulabbis to the establishment of two new institutions: the Madrasa Al-Ashrafiyya, and a mosque in Gaza. Qaytbay's new madrasa, replacing the old one by Khushqadam, was built between 1480 and 1482 CE. As Qaytbay estimated that local craftsmanship did not live up to his standards, he commissioned a team of builders and artisans from Cairo, including a Coptic architect, to work on this project. This marks a relatively rare occasion where a Mamluk sultan commissioned a construction project of such significance outside of Cairo. Just three months after the completion of the madrasa, Qaytbay then ordered the sabil (fountain house or water dispensary) to its northeast to be rebuilt, resulting in the Sabil of Qaytbay, which still stands there today.

A strong earthquake destroyed much of the upper floor of the madrasa in 1496. Today, only parts of the lower stories have survived, but the original structure is known thanks to extensive contemporary documentation and modern-day investigation of its remains.

Its ground floor housed the al-Aqsa Library between 1977 and 2000. The building underwent years of considerable rehabilitation in the 2000s. Since 2008, it has been repurposed as the al-Aqsa Center for the Restoration of Islamic Manuscripts (مركز ترميم المخطوطات الإسلامية), including a restoration lab for its technicians.

Architectural description
The madrasa was built on two stories on the western side of the Haram al-Sharif, facing towards the Dome of the Rock. The facade of the building is 25 meters wide and projects in front of the long arcade which runs along the western boundary of the Haram al-Sharif, which would have made the madrasa very prominent, a feature likely owed to its royal patronage.

The madrasa was centered around a large rectangular courtyard similar to those built by Qaytbay earlier at his own funerary mosque-madrasa in Cairo and in other late Mamluk madrasas of the period. However, the eastern side of the courtyard was taken up by a triple-arched loggia which, thanks to its elevated position, provided an unimpeded view of the Dome of the Rock. Living quarters for students were arranged around another upper courtyard or terrace built over the adjacent Baladiyya Madrasa.

According to Mujīr al-Dīn al-'Ulaymī, who was a historian at that time, the madrasa was the third jewel of Masjid Bayt al-Maqdis (the Haram al-Sharif), after al-Aqsa Mosque and the Dome of the Rock.

Environs
It is located in the western esplanade of the al-Aqsa Compound, with many other notable structures around:
 * To its south are the Chain Gate, the Chain Gate Minaret, and at-Tankiziyya Madrasa.
 * To its north are the al-Uthmaniyya Madrasa and Ablution Gate.
 * To its northeast is the Fountain of Qayt Bay.
 * To its west is the Baladiyya Madrasa.
 * To its east are the an-Nāranj Pool and Fountain of Qasim Pasha.
 * To its southeast is the Dome of Moses.