The region on which Gainesville now stands once belonged to the Timucuan tribe. The land was claimed by the Spanish crown and settled by colonists who used the land for ranching and the natives as slave labor. In 1817, the land was given to Don Fernando de la Maza Arredondo, but the fledging United States annexed the entire Florida peninsula just seven years later. American farmers moved in, and the city became the Alachua County seat in 1854. A train station on the Florida Railroad Company was also built here at one point, transporting goods from New Orleans to New York. During the Civil War, Gainesville was home to a Confederate storehouse, which led to a February 1864 skirmish and a subsequent August battle in which the Union suffered significant losses.

After the war ended, Gainesville refocused on agriculture and became a major growing and shipping center for citrus fruits, vegetables and cotton. By the 1890s, when record-setting winters killed off large parts of the crops, Gainesville had significant phosphate mining and lumber industries in place.

In 1905, the University of Florida was founded here, turning the city into a center of education and culture. The city developed at a brisk pace, drawing large populations of South Carolinian freed slaves. Thanks to the economic revival brought about by the university, the population surpassed 10,000 by 1920. This led to extensive development that destroyed much of historic Gainesville, a misfortune that has since been partially corrected by restoration and reconstruction projects.