A kasbah (, also ; , , Maghrebi Arabic: ), also spelled qasba, qasaba, or casbah, is a fortress, most commonly the citadel or fortified quarter of a city. It is also equivalent to the term alcazaba in Spanish (), which derives from the same Arabic word. By extension, the term can also refer to a medina quarter, particularly in Algeria. In various languages, the Arabic word, or local words borrowed from the Arabic word, can also refer to a settlement, a fort, a watchtower, or a blockhouse. Citadel or fortress The term qasaba was historically flexible but it essentially denotes a fortress, commonly a citadel that protects a city or settlement area, or that serves as the administrative center. A kasbah citadel typically housed the military garrison and other privileged buildings such as a palace, along with other amenities such as a mosque and a hammam (bathhouse). Some kasbahs are built in a strategic elevated position overlooking the city, like the Kasbah of the Oudayas in Rabat, Morocco, or the Alcazaba of Málaga in Spain. It could also be a large purpose-built royal quarter, protected by its own set of walls, that housed the palace of the ruler and the administration of the state. Examples of this include the Kasbah of Marrakesh and the Kasbah of Tunis, both founded by the Almohads, who built or redeveloped similar palace enclosures in many important cities of their empire. In some cases, kasbahs could be simple fortified enclosures around a city that housed military garrisons, without being the main citadel. In Fez, for example, there were up to 13 kasbahs built throughout the city in different periods, including the Kasbah an-Nouar and the Kasbah Cherarda. According to architect and restorer Leopoldo Torres Balbás, the Alcazaba of Málaga is the prototype of military architecture in the Taifa period in Al-Andalus, with its double wall and many fortifications. Its only parallel is the castle of Krak des Chevaliers in Syria. Examples of other alcazabas in Spain include the Alcazaba of Almería, the Alcazaba of Antequera, the Alcazaba of Badajoz, the Alcazaba of Guadix, the Alcazaba of Mérida, the Castle of Molina de Aragón, the Alcazaba of Alcalá la Real and in the Alcazaba of the Alhambra in Granada. In Morocco, the term "kasbah" is also used in predominantly Amazigh regions to denote a fortified residence (tighremt in Amazigh languages), often built of mudbrick, such