Twenty percent of the United States budget in 1800 was devoted to paying ransom and tribute to pirates. Prior to declaring independence ships from the America's were protected under British treaties. That protection ended when the United States declared independence and in 1777 Morocco recognized the United States as an independent nation making it fair game to start seizing its ships. One result was the creation of the United States Navy. Yet as more ships were seized by various Barbary Coast nations the United States scrambled to sign treaties of their own with these nations and paid them protection fees.