Although Jefferson cut back the army and navy sharply in order to save money, he temporarily escaped the consequences of leaving the country undefended because of the lull in the European war signalized by the Treaty of Amiens between Great Britain and France in March 1802. Despite the fact that he had only seven frigates, he even managed to fight a small naval war with the Barbary pirates without damage to American interests or prestige.
The North African Arab states of Morocco, Algiers, Tunis, and Tripoli had for decades made a business of piracy, seizing vessels all over the Mediterranean and holding crews and passengers for ransom. The European powers found it simpler to pay them annual protection money than to crush them. Under Washington and Adams, the United States joined in the payment of this tribute; while large, the sums were less than the increased costs of insurance for shippers when the protection was not purchased.
Such spinelessness ran against Jefferson’s grain. “When this idea comes across my mind, my faculties are absolutely suspended between indignation and impatience,” he said. When the pasha of Tripoli tried to raise the charges, Jefferson balked. Tripoli then declared war in May 1801, and Jefferson dispatched a squadron to the Mediterranean.
But the pirates were not overwhelmed, and a major American warship, the frigate Philadelphia, had to be destroyed after running aground off the Tripolitan coast. The payment of tribute continued until 1815. Just the same, America, though far removed from the pirate bases, was the only maritime nation that tried to resist the blackmail. Although the war failed to achieve Jefferson’s purpose of ending the payments, the pasha agreed to a new treaty more favorable to the United States, and American sailors, led by Commodore Edward Preble, won valuable experience and a large portion of fame. The greatest hero was Lieutenant Stephen Decatur, who captured two pirate ships, led ten men in a daring raid on another in which he took on a gigantic sailor in a wild battle of cutlass against boarding pike, and snatched the stricken Philadelphia from the pirates by sneaking aboard and setting it afire.