Wikala of Sultan Qaytbay

The Wikala of Sultan Qaytbay or Wakala of Sultan Qaytbay (among other variations) is an urban caravanserai (wikala or wakala) and rab (apartment complex) built by Sultan al-Ashraf Abu al-Nasr Qaitbay in 1481 CE in Islamic Cairo, the historic medieval district of Cairo, Egypt.

Historical context and location
The structure is located next to the inner side of Bab al-Nasr, a monumental 11th-century fortified gate in Cairo's Fatimid-era walls. This location placed it at one of the main entrances to the city and at the beginning of one of the major streets leading towards its center.

Sultan Qaytbay, one of the most prolific architectural patrons in Mamluk history, had this wikala built in 1481. While the Mamluk Empire was nearing its decline, Qaytbay oversaw a period of relative stability and prosperity, and commerce was still vigorous. Many similar wikalas were built along the city's major commercial zones, such as Qaytbay's earlier Sabil-kuttab-wikala built in 1477 near al-Azhar Mosque, the later wikala built by Sultan al-Ghuri, or the various khans and wikalas built around Khan al-Khalili. Like other Mamluk buildings, this structure combines more than one function, and like some other wikalas, it was both a caravanserai for merchants and a rab' or residential complex with rented units.

The wikala has in modern times been used as a tenement (not unlike its original function), but has suffered in part as a result of this and has lost some of its elements. It is under comprehensive restoration as of December 2015 by the Egyptian Ministry of Antiquities. There are concerns regarding relocation of shops and workshops that occupy the front of the wikala.

Architecture
The structure follows a standard model of wikala buildings from the late Burji Mamluk period onwards, of which the best-preserved example today is the Wikala of Sultan al-Ghuri built in 1505 further south. Its street facade is centered around a relatively monumental stone portal with stone vaulting and ornamentation typical of Qaytbay's time, including ablaq masonry and muqarnas carving. On either side, on the ground level, are spaces for shops, still present today. On the upper floors are the limited remains of mashrabiyyas (wooden screens) which characterized the living spaces, though much of the building's ruined upper façade appears to have been filled-in by more recent and more simple construction.

The main portal entrance opens to a passage covered by a Mamluk-style groin vault, which in turn leads to the main courtyard which dominates the interior floor plan. Around this courtyard were rooms for storage on the first floor (for use by merchants and their animals), while the upper floors were occupied by living quarters. These upper floors functioned as a rab', a residential complex with apartments that were rented and whose revenues were then used for the upkeep of this building or possibly for other waqfs (charitable foundations) elsewhere. Each apartment unit was spread over two levels, with the upper level having rooms that looked onto a reception room (qa'a) on the level below, which in turn had a view onto the street outside.