In 19th century Africa, it was sometimes the natives who enslaved the whites:
In 1817, the American sea captain, James Riley, published *An Authentic Narrative of the Loss of the American Brig “Commerce,” Wrecked on the Western Coast of Africa , in the Month of August, 1815, with an Account of the Sufferings of the Surviving Officers and Crew, who were Enslaved by the Wandering Arabs of the Great African Desert or Zahahrah*. More recently, Captain Riley’s memoire has been reprinted, though with a title that better fits modern sensibilities: *Sufferings in Africa: the Incredible True Story of a Shipwreck, Enslavement, and Survival on the Sahara* (New York: Skyhorse, 2007). This edition, along with a fictionalized version by Dean King, called *Skeletons on the Zahara: A True Story of Survival* (New York: Back Bay Books, 2005) enjoy respectable sales for reprints of a book nearly two centuries old.More details at The Public Domain Review, which has link to full-text versions of the books being discussed.
Captain Riley’s story is pretty well summed up by the original title of his book. While sailing from Gibraltar to the Cape Verde Islands, Riley’s mid-sized merchant ship got lost in the fog and wrecked on the west Moroccan coast. Trapped on shore and having run out of both food and water, Riley and the surviving crew threw themselves on the mercy of some passing Berber tribesmen, who promptly enslaved and carried them off into the desert. Abused, underfed, and overworked, the captives were nearly dead when their masters sold them to an Arab trader, who bought the Americans on Riley’s promise of ransom if they returned to the coast. The rest of An Authentic Narrative recounts the survivors’ slightly less brutal journey over desert and mountains to the port city of Mogador (modern Essaouira) and their eventual freedom.