This will be brief. I can recommend reading this article about the early United States versus the Barbary Pirates.
Yes, we indeed paid tribute and ransoms.
True: Thomas Jefferson spoke out about that and tried to fight back. But...
(below the fold)
When Jefferson became president in 1801 he refused to accede to Tripoli's demands for an immediate payment of $225,000 and an annual payment of $25,000. The pasha of Tripoli then declared war on the United States. Although as secretary of state and vice president he had opposed developing an American navy capable of anything more than coastal defense, President Jefferson dispatched a squadron of naval vessels to the Mediterranean. [....]
[...] However, it was not until 1805, when an American fleet under Commodore John Rogers and a land force raised by an American naval agent to the Barbary powers, Captain William Eaton, threatened to capture Tripoli and install the brother of Tripoli's pasha on the throne, that a treaty brought an end to the hostilities. Negotiated by Tobias Lear, former secretary to President Washington and now consul general in Algiers, the treaty of 1805 still required the United States to pay a ransom of $60,000 for each of the sailors held by the dey of Algiers, and so it went without Senatorial consent until April 1806.
(emphasis mine)
The payments finally stopped in 1815.
I find it interesting that slogans ("We don't negotiate with terrorists") are equated with actual knowledge.
I can recommend the book Faith, Power and Fantasy by Michael Oren for more details. It makes for interesting reading.