Until the American Declaration of Independence in 1776, British treaties with the North African states protected American ships from the Barbary corsairs. Morocco, which in 1777 was the first independent nation to publicly recognize the United States, in 1784 became the first Barbary power to seize an American vessel after the nation achieved independence. The Barbary threat led directly to the United States founding the United States Navy in March 1794. While the United States did secure peace treaties with the Barbary states, it was obliged to pay tribute for protection from attack. The burden was substantial: in 1800 payments in ransom and tribute to the Barbary states amounted to 20% of United States federal government's annual expenditures.