The city was co-founded by John C. Williams, formerly of Detroit, Michigan, who purchased the land in 1876, and by Peter Demens, who was instrumental in bringing the terminus of a railroad there in 1888. St. Petersburg was incorporated on February 29, 1892, when it had a population of only some 300 people.
The city was named after Saint Petersburg, Russia, where Peter Demens had spent half of his youth. A local legend says that John C. Williams and Peter Demens flipped a coin to see who would have the honor of naming the city. Peter Demens won and named the city after his birthplace, while John C. Williams named the first hotel after his birthplace, Detroit. The Detroit Hotel still exists downtown, but has since been turned into a condominum.
In 1899, the city's first major industry was born when Henry W. Hibbs established his wholesale fish business at the end of the railroad pier, which extended out to the shipping channel. Within a year, Hibbs Fish Company was shipping more than 1,000 pounds of fish each day.