Some more recent history:
Barbary pirates and the U.S. Navy
When the U.S. became a country it had little in the way of a navy to protect its merchant ships, so in 1784, Congress appropriated $60,000 as tribute to the Barbary states. But continued attacks prompted the building of the United States Navy, including one of America's most famous ships, the USS Philadelphia, leading to a series of wars along the North African coast, starting in 1801. It was not until 1815 that naval victories ended tribute payments by the U.S., although some European nations continued annual payments until the 1830s.
The United States Marine Corps actions in these wars led to the line, "to the shores of Tripoli" in the opening of the Marine Hymn.
http://en.wikipedia.org/wiki/Barbary_pirates