Following the repeal of the Embargo Act of 1807, Gallatin was charged with enforcing the Non-Intercourse Act of 1809, which lifted parts of the trade embargo but still prevented American ships from engaging in trade with the British and French empires. In 1811, Congress replaced the Non-Intercourse Act of 1809 with a law known as Macon's Bill Number 2, which authorized the president to restore trade with either France or Britain if either promised to respect American neutrality. As with previous embargo policies pursued by the federal government under Jefferson and Madison, Macon's Bill Number 2 proved to be ineffective at halting the attacks on American shipping. In June 1812, Madison signed a declaration of war against Britain, beginning the War of 1812.