Ksar means a "fortified village", or simply a "castle" or "palace" According to theory, it was built between the 12th and 14th century Its rooms are isolated so it could also have been a caravanserai.