Between 25,000 and 30,000 Indians lived in the area now covered by the state of Mississippi when the first European explorers arrived. Chief among the tribes were the Chickasaw, Choctaw, and Natchez. The Spanish explorer De Soto was the first European to set foot in Mississippi. He discovered the Mississippi River in 1541. French explorers descended the Mississippi in 1682 and claimed the entire Mississippi Valley for France. The future state of Mississippi was included in this area. The first French settlement came in 1699, followed in 1716 by another near present-day Natchez. The first African slaves were brought to Misssissippi in 1719 to work in rice and tobacco fields. All French possessions east of the Mississippi River were ceded to the British in 1763. After the War for Independence, British territories in the area were turned over to the United States. Spain retained control of the area below the 31st parallel as West Florida until 1810. In 1817, Congress divided the Mississippi Territory into two parts. The eastern part became the Territory of Alabama, while the west became the state of Mississippi. The state capital was located in various cities until it settled in Jackson in 1822. Most of the Indian tribes in Mississippi were gradually forced off their land and onto reservations in Indian Territory, now Oklahoma. The land they left was often ideally suited for cotton farming, which had grown greatly since Eli Whitney's invention of the cotton gin in 1793. Mississippi became one of the wealthiest states in the nation, with an economy based on slaves. Mississippi was one of the first Southern states to secede in 1861. Its legislature had passed resolutions on November 20, 1860, describing the reasons why secession had become necessary. January 9, less than three weeks after South Carolina had seceded, Mississippi became the second. During the Civil War, several major battles were fought in Mississippi, including Vicksburg, which fell to General Ulysses S. Grant on July 4, 1863. The state was placed under the Reconstruction regime following the war and was readmitted as a state in 1870. In the middle of the 20th century, the advancement of civil rights was strongly resisted by white residents of the state. Riots occurred when the first black student came to the University of Mississippi. The legal system of Mississippi offered little protection to civil rights workers of either race, several of whom were murdered. Barry Goldwater carried Mississippi by a wide margin for the Republican Party in 1964, marking a shift away from dominance by the Democratic Party that had prevailed for a century.