The area now known as Texas was inhabited by a variety of Native American peoples before contact with Europeans. Pueblo peoples, Mississippian cultures, and central American polities all exercised influence over the region, which was the scene of cultural exchange in the form of warfare and trade for centuries. While numerous Spanish explorers passed through its borders, it was not permanently settled by Europeans until the late seventeenth century, when Spanish missions began to emerge. San Antonio became the first permanent settlement in the colony, which was considered a backwater within the Spanish Empire. Texas became part of Mexico after that nation won independence in 1821, and to settle the land, the Mexican government encouraged American farmers to immigrate. Political tensions with these settlers led to the Texas Revolution in the 1830s. A few years after Texas won its independence, it was annexed by the United States, which led to war between the United States and Mexico. Texas became a large producer of cotton, and therefore acquired a large population of slaves (one of the reasons for tensions with Mexico, where slavery had been outlawed.) As a result, Texas was among the first wave of states to secede from the Union before the Civil War. In the twentieth century, oil discoveries and other factors drew millions of Americans to cities like Dallas and Houston, which became some of the largest urban centers in the United States. Texas remains one of the largest and influential states politically and culturally in the United States.