Huntsville, Texas is the seat of Walker County and is located near the center of the county. Originally located in the northeast section of Montgomery County, the site was founded by Pleasant and Ephraim Gray in 1836, and named for Huntsville, Alabama, former home of the Gray family. The Grays operated an Indian trading post, where they were well situated to to trade with the Bidai, Alabama, and Coushatta Indians. In 1837, the site acquired a post office, and in 1846 Huntsville was designated seat of Walker County, and the town moved to the center of the newly established county. Trade along the Trinity River increased and colonists arrived to claim the timber. During the 1840s and 1850s, prominent and well-to-do families moved into the area, including Sam Houston. The area quickly became a center for higher learning. At the end of its first decade, Huntsville also became the site of the new Texas State Penitentiary, established by the legislature in 1847, and the prison received its first convict in 1849. During the Civil War, the penitentiary produced cloth for Confederate soldier uniforms. In 1867, a yellow fever epidemic struck Huntsville, killing 10% of the population and severely wounding economic development. Then in 1872, the Houston and Great Northern Railroad bypassed Huntsville to the east. Later that same year, Huntsville acquired a rail connection when the eight-mile Huntsville Branch linked it to the H&GN at Phelps. By 1875, Huntsville was also a stop on four stage routes. During Reconstruction, Walker County was one of three Texas counties put under martial law for six days. Lumber, agriculture, and tourism have been the economic mainstays of the city.