 The city of Shafter began as a loading dock along the Santa Fe Railroad right-of-way.The community was named for General William Rufus Shafter who commanded US Forces in Cuba during the Spanish–American War.Property was sold beginning in 1914 and the city incorporated on January 11, 1938.