The Barbary Wars were fought in the early 19th century between the United States and the Barbary states. The wars were in reaction to Barbary pirates who demanded tribute from American merchant vessels or face being captured and the crew either being ransomed or enslaved. Without a navy, the United States paid nearly a fifth of its annual budget in tribute to pirates. The United States responded by building heavy frigates and establishing the U.S. Navy. In 1799, the Federalist Party adopted the slogan, Millions for defense, but not one cent for tribute.