Signed in December 1814, the Treaty of Ghent ended the War of 1812, returning the boundaries of British North America and the United States to the state they were prior to the war. In the following decades, the United States and the United Kingdom concluded several treaties that settled the major boundary disputes between the two, enabling the border to be demilitarized. The Rush–Bagot Treaty of 1817 provided a plan for demilitarizing the two combatant sides in the War of 1812 and also laid out preliminary principles for drawing a border between British North America and the United States.