I didn't know the Barbary pirates were moslems disrupting world trade. The US response was to start a Navy and the Marines. Hence "...to the shores of Tripoli..." in the song. The European response of paying bribes/tributes and the US response of war (after long inaction) sounds similar to today's news.
The islamic MO is still the same. They stop their attacks when confronted with overwhelming force. Go Bush!
The United States and the Barbary Pirates
The American Revolution was barely over before the United States faced its first foreign policy test. What should the United States do about North African pirate states that plundered American shipping?
On September 11, 2001, terrorists struck the United States, killing about 4,000 people. The U.S. president responded by declaring a war on terrorism. He got Congress to authorize using force against any nation, organization, or person involved in the attack or against any nation harboring the terrorist organizations.
When the United States began, it faced another foreign policy test: How should it respond to the Barbary pirates who were plundering its ships?
In the 1700s, the countries along the southern coastline of the Mediterranean Sea were called the Barbary States. They included Morocco, Algiers, Tunis, and Tripoli. Named after the Berbers, one of North Africa's native peoples, the Barbary States were little pirate kingdoms that plundered the merchant ships of many nations.
The Barbary pirates were mostly Berbers, Arabs, and other Muslims, but some came from Christian Europe. The pirates used small, fast-moving vessels to capture trading ships and their cargoes. They held the crews and passengers for ransom or sold them as slaves.
Each of the four Barbary States had its own ruler. He was usually a military strongman who had grabbed the throne by assassinating the ruler or murdering rival family members.
In 1662, England made the first treaty with a Barbary ruler. This set the pattern for similar treaties by other European nations trading in the Mediterranean. Typically, a Barbary peace treaty required a nation to pay "tribute" to the pirate ruler, who would then call off attacks on the nation's ships. Tribute usually took the form of a large payment of money plus annual payments. The annual payments might be cash, military supplies, or expensive presents for the ruler. A particular treaty might also include ransom money for the release of a nation's citizens held captive by the Barbary country.
The Barbary rulers frequently demanded that nations "renew" their treaties for even greater amounts of tribute. Until a nation agreed to new terms, its ships remained fair game for the pirates.
The war fleets of the European powers could easily have defeated the Barbary pirate ships. Yet the Europeans agreed to the tribute treaties. Nations like England believed that by paying tribute they not only bought protection for themselves but also redirected the pirates to wreak havoc on the merchant ships of competing nations.