“From the halls of Montezuma, to the shores of Tripoli...” are the beginning lines from the United States Marine Corps Hymn, and the “Tripoli” that's mentioned is the largest city in today's Libya. The hymn was written sometime after 1867, and these lines commemorate two of the Marine Corps' most famous battles “the halls of Montezuma referring to the Mexican-American War of 1846-48, and “the shores of Tripoli” refers to the battles the Marine Corps, along with the US Navy, fought with the infamous “Barbary Pirates” who terrorized the coast of North Africa, the Mediterranean Sea and indeed, a large part of Europe for at three centuries.
Slavery had existed in the Mediterranean Basin since before the time of Rome. During the Roman expansion, people from all corners of the empire were enslaved: Franks, Germans, Slavs, Greeks, various people from the Balkans, Africans traded to Rome by Egypt, Jews from Israel and more. Some of the richest people in Rome and the Gothic and Arab empires which followed it were slave traders. Many Viking raiders grew rich and powerful from the treasure they hoarded trading slaves. Slavery was common in Europe, the north coast of Africa, and the Middle East until relatively recent times.
The Barbary States
In the 1500s, the Ottoman Turks expanded along the North African coast. Due to distance and the fiercely independent nature of the Berbers and others, however, Ottoman control of the Barbary Coast was nominal. As long as the people there recognized the Ottoman Sultan as their overlord and gave help when it was asked, the Turks left the people of the coast alone.
One of the many interesting things about the Barbary Pirates is that, as time went on, many of them were not from the region. Many were Europeans, acting much like today's mercenaries, looking for adventure and a quick buck. Unfortunately, what they were mainly looking for were other human being to sell into slavery.