Constant partitioning and The Second Seminole War slowed the county's development, but the coming of the Florida Railroad opened up the interior for both settlement and trading. The route cut diagonally across the county and bypassed the county seat at Newnansville in the northwest. As a result, it was decided at a Boulware Springs meeting on September 6, 1853, to move the county seat near the railroad and create the new town of Gainesville. By 1860, Alachua County had more than 8,000 inhabitants, while Gainesville, its main city, had some 232 residents. During the Civil War, Gainesville served as a major Confederate Commissary and was the site of two battles, a skirmish on February 14, 1864, and a larger battle on August 17, 1864, in which J. J. Dickison routed superior Union forces to deter the Union occupation of North Florida. Reconstruction brought martial law, Republican rule, the immigration of freed slaves and economic prosperity. Two main schools were established, The Union Academy for African-Americans and East Florida Seminary for whites.
By the end of Reconstruction, Alachua County had a population of more than 18,000, while Gainesville, with 1,400 residents, was a mercantile center for cotton and vegetable crops. During the next 25 years, the county continued to prosper as the citrus and phosphate industries gave it a secure economic base. After two major fires in the 1880s, Gainesville rebuilt with an emphasis on brick structures, and an imposing new red-brick courthouse symbolized its growth from town to city. Gainesville's central location brought two more railroad connections, with trains coming down Main Street. With a population approaching 3,000, the city was one of the state's largest. The town had an opera house, paved streets, city water, telephones and electric lights. East Florida Seminary expanded, becoming a military school, while a new public school was erected. Merchants such as Dutton, Miller and Baird built fine new homes near downtown and fashionable districts were created in the southeast and along University Avenue.
New towns--including Archer, High Springs, Melrose and Hawthorne- -spawned by the railroad expansion and the citrus and phosphate boom welcomed investors, tourists and speculators. Although severe freezes in the 1890s blighted much of this prosperity, Alachua County entered the 20th century with a population of 32,000 and a growing economy centered in the phosphate, cotton and vegetable industries.