Much has been written about how Thomas Jefferson was the first American president to confront African pirates. That's true. But did you know that in 1783, before the Constitution was drafted and enacted, the United States Congress offered to pay $80,000 in ransom to pirates who commandeered three American ships? That's the equivalent of roughly $38 million today. In the end, a treaty saved us from having to fork over the money.
Know why the Marine Hymn includes the phrases "to the shores of Tripoli"? It's because America fought a whole war—The Tripolitan War, from 1801 to 1805—to stop piracy and keep shipping lanes open. The war ended successfully for the US, but only after a $60,000 "tribute" was paid to Tripoli's "pasha." At least Jefferson was willing to fight the pirates. His predecessors, George and Washington and John Adams, were not. They found it cheaper to pay off the bandits than fight them.
Even into the 1830s, when America had better established herself as an international power, we had a sporadic pirate problem. This time it was Malayan pirates, off the coast of Indonesia, who seized an American vessel, killed some of its sailors, and made off with the ship's cargo. President Andrew Jackson, always spoiling for a fight, sent a large warship to the East Indies and tore the place up. Don't expect that to happen anytime soon.