On December 22, 1807, President Thomas Jefferson (1743–1826) signed the Embargo Act, prohibiting ships that were destined for foreign ports from leaving the United States. The legislation had been drawn up in an effort to pressure France and Britain, which were then at war and had been seizing U.S. merchant ships to prevent each other from receiving American goods. The situation began after the French navy was crushed by the British under Admiral Horatio Nelson (1758–1805) at the Battle of Trafalgar (October 1805). French ruler Napoleon Bonaparte (1769–1821) turned to economic warfare in his long struggle with the British, directing all countries under French control not to trade with Britain. Its economy dependent on trade, Britain struck back by imposing a naval blockade on France, which soon interfered with U.S. shipping. Ever since the struggle between the two European powers had begun in 1793, the United States had tried to remain neutral. But the interruption of shipping to and from the Continent and the search and seizure of ships posed significant problems to the American export business. The Embargo Act was an attempt to solve these problems without getting involved in the conflict. But the effort failed. The embargo made sales of U.S. farm surpluses impossible. New England shippers protested the act and were joined by southern cotton and tobacco planters in their opposition. Nevertheless, the embargo remained in effect for 14 months, during which the American economy suffered and many ships resorted to smuggling. In 1809 Congress passed the Non-Intercourse Act, which limited the shipping embargo to France and Britain; all other foreign ports were again open to U.S. ships. Three years later, the United States was drawn into the conflict, fighting the British in the War of 1812 (1812–14).