By the mid-sixteenth century Libya came under the control of the Ottoman Turks. However, this meant the payment of taxes, not surrender of local control. During the next three centuries much of coastal Libya was controlled by pirate captains, exacting tribute from ever increasing sea trade. In 1711 domination of coastal trade came under the control of the Karamanli Dynasty, and coastal Libya became known to tribute-paying European sea captains as the Barbary Coast (after Berber).
In 1802 the infant United States became embroiled in a conflict over tribute and Tripoli's holding hostage the crew of the U. S. warship Philadelphia. The landing of marines, and the payment of tribute, gained both the crew's freedom and a treaty—as well as a line in the modern anthem of the U. S. Marines: "From the halls of Montezuma to the shores of Tripoli."
In the early nineteenth century the materialism of the Kara-manli Dynasty stimulated an orthodox Sunni Islam movement, started by Mohamad bin Ali al-Sanusi (1787-1859). Lodges constructed for travelers soon became a network of religious centers particularly appealing to the Bedouin traders of Cyrenaica and Fezzan. The resulting Sanusi movement advocated a reinvigorated Islam and vigorously opposed the spread of European influence. Sanusi lodges continued to play an important role in Islamic life until they were closed by Italians in the early 1930's.