After protecting miners from Native Americans with the Buckskin Rangers in California, Hamilton worked for the government protecting pioneers from Native Americans in Nevada, Oregon and Montana and was a scout for George Armstrong Custer from the 1850s through the 1870s. During that time period, he also worked as a trader at Fort Benton, around Flathead Lake, and in 1858 he established a trading post along Rattlesnake Creek, being the first cabin built near what would become Missoula. He also served as the sheriff of Chouteau County, Montana, and then as a U.S. Marshal in 1869. Continuing his work for the government, he worked with the Blackfoot People in 1873. Three years later he served under General George Crook and fought the Sioux in the Great Sioux War of 1876.