Look up First Barbary War on Wikipedia.
According to Robert Davis, between 1 and 1.25 million Europeans were captured by Barbary pirates and sold as slaves between the 16th and 19th centuries.
Also, look up the historical accounts of the terrorism that led to the Barbary Wars.
The few surviving historical accounts suggest that Yusuf Karamanli was “feared and hated” in Tripoli; one American diplomat who dealt with him extensively described him as “a large, vulgar beast,” “a bully,” and “a cur who can be disciplined only with the whip.” One of Yusuf ’s first acts as bashaw was to sign with the United States on 4 November 1796 a treaty of “firm and perpetual peace and friendship,” which was rati- fied with the unanimous (23–0) advice and consent of the Senate on 7 June 1796. Article 10 of this treaty specified that no “periodical tribute or farther payment is ever to be made by either party.” Article 12 provided that in the event of a dispute neither party would resort to arms but that the dispute would be submitted to the dey of Algiers for binding resolution.
Documents referenced in the treaty acknowledged a receipt of a one-time payment of forty thousand Spanish dollars, assorted watches, rings, and fancy cloth. Additionally, there was a “note” in which the U.S. government promised that each new consul appointed to represent the United States in Tripoli would bring twelve thousand Spanish dollars and specified quantities of artillery, anchors, pine and oak boards (wood being scarce in the desert), and other valuable commodities. This, of course, provided a strong incentive for the bashaw to quarrel with any American diplomat, as an excuse to declare him persona non grata and set the stage for a successor with a new installment of treasure.