It turns out that it is the Arabic word for a citadel, or fortress. The word citadel comes from cīvitātem (Latin), the literal meaning of which is "little city." According to the OED, cīvitātem referred specifically to the fortified, innermost part of a city. Citadels were typically built on hills, making them easier to defend. The OED notes that the citadel has another purpose besides protection, as illustrated in this quote, dated 1598: FLORIO, Citadella...a citadell, castell, or spacious fort built not onely to defend the citie, but also to keepe the same in awe and subjection.
Florio is John (or Giovanni) Florio; he was a linguist, lexicographer and royal language tutor. Interesting guy! The quote appears to have been taken from his Italian/English dictionary, A Worlde of Wordes.
Casbah comes from قصبة, or qasbah. The term is applied to North African citadels or castles, or the city quarter surrounding a casbah. "The Casbah" refers specifically to the Casbah of Algiers, which is located in Algeria and contains mosques dating back to the 1600s.