The Barbary pirates, sometimes called Barbary corsairs or Ottoman corsairs, were Ottoman and Berber pirates and privateers who operated from North Africa, based primarily in the ports of Salé, Rabat, Algiers, Tunis, and Tripoli.