Barbary States

The Barbary States, also known as the Barbary Pirates or Barbary Corsairs were a group of pirate North African Berber states centered at Tunis and Algiers. From the 1500s onwards, they proved a threat to Mediterranean shipping, with Hayreddin Barbarossa and Dragut Reis becoming the most feared of them all. In 1527 the Christians captured Tunis, but their final downfall came in 1827, when the United States aided in the destruction of their pirate fleets.

History
A colloquial term for the Bey of Tunis and Dey of Algiers, the Barbary States were a group of seafaring Berbers who raided European shipping while under the protection of the Ottoman Empire. In the 1500s they assisted the Ottomans and French in the wars with the Holy Roman Empire and Habsburg Empire possessions, and in 1527 they lost Tunis to an attack by Charles V of Germany. It was recaptured soon after and they assisted in a failed siege of Malta in 1565, among many other actions against Christian kingdoms. They were responsible for blockading trade routes, and their mortal foes were the Knights of St. John.

In the 1700s they had a revolution and became a republic, and in the 1820s a Kingdom of Tunis was formed in rebellion. Eventually the Spanish formed a North African empire and conquered the Barbary States, after a series of wars between the Barbary States and every European (as well as the United States) power.