In April 1798 Congress created the Mississippi Territory, which lay to the east of the Mississippi River. It was established on the 31st parallel and created a boundary line between Spanish Florida and the United States. In 1804, its northern boundary was extended to the Tennessee River and in 1812, President James Madison added West Florida, part of the Louisiana Purchase. By 1813, the boundaries of the Mississippi Territory encompassed Alabama and Mississippi, which were to become states in 1817 and 1819 respectively. Its governance was by a ruling council, consisting of a governor, secretary and three judges. Slavery was permitted and many slaves were brought in to work on the newly established cotton plantations. There were also wars with Indian tribes over land encroachment. In 1818 US forces fought the Seminole Indians in Spanish-controlled East Florida, with Spain ceding East Florida to the US in 1821.