
Ksar or qṣar (Arabic: قصر, romanized: qaṣr), in plural ksour or qsour (Arabic: قصور, romanized: quṣūr), is a type of fortified village in North Africa, usually found in the regions predominantly or traditionally inhabited by Berbers (Amazigh). The equivalent Berber term used is ighrem (singular) or igherman (plural).
The Arabic qaṣr (قصر), frequently pronounced qṣar in the Maghreb, was probably borrowed from the Latin word castrum.
Ksour or igherman are widespread among the oasis populations of North Africa, found in Tunisia, Algeria, and Libya, and are also found on the Djado Plateau and in the commune of Fachi in Niger. They are sometimes situated in mountain locations to make defense easier; they often are entirely within a single, continuous wall.

Ksour in the Maghreb typically consist of attached houses, often having a granary like the fortified granaries of Aures in Algeria, or the ghorfa and agadir types known in Tunisia and Morocco respectively, beside other structures like a mosque, hammam, oven, and shops.
The building material of the entire structure is usually adobe, or cut stone, salt bricks from Taoudenni, and adobe. The conception of the ksar as a granary is a confused notion of two things: the granary found within a ksar, and the ksar itself, a village, typically with granaries within it. Ksars are among the main manifestations of Berber architecture.