When I lived in Libya I had the opportunity to visit the beautiful fortified Berber granaries, which dot the northern fringes of the Sahara in Libya itself as well as in the neighbouring country of Tunisia. These qasrs, or ksars, are up to one thousand years old. They were used to protect food supplies from raiding parties.
The one featured in the first two pictures, Ksar Ouled Soltane, may look familiar to you, as it featured as slave quarters in one of the highest grossing movies of all time, Star Wars Episode I: The Phantom Menace.
The third photo is of the perfectly circular fort of Qasr al-Haj in Libya, which has been in continuous use by the Berbers for more than 800 years.