William Rufus Shafter (October 16, 1835 - November 12, 1906) was a Union Army officer during the American Civil War who received America's highest military decoration, the Medal of Honor, for his actions at the Battle of Fair Oaks. Shafter also played a prominent part as a major general in the Spanish-American War. Fort Shafter, Hawaii, is named for him, as well as the city of Shafter, California and the ghost town of Shafter, Texas. He was known informally as "Pecos Bill".
Shafter served as a 1st lieutenant the Union Army's 7th Michigan Volunteer Infantry Regiment at the battles of Ball's Bluff and Fair Oaks. He was wounded at the Battle of Fair Oaks and later received the Medal of Honor for heroism during the battle. He led a charge on the first day of the battle and was wounded towards the close of that day's fighting. In order to stay with his regiment he concealed his wounds, fighting on the second day of the battle. On August 22, 1862 he was mustered out of the volunteer service but returned to the field as major in the 19th Michigan Volunteer Infantry Regiment. He was captured at the Battle of Thompson's Station and spent 3 months in a Confederate prison. In April 1864 after his release he was appointed colonel of the 17th Regiment of U.S. Colored Troops and led the regiment at the Battle of Nashville.
By the end of the war, he had been promoted to brevet brigadier general of volunteers. He stayed in the regular army when the war ended. During his subsequent service in the Indian Wars, he received his nickname "Pecos Bill". He led the 24th Infantry, another United States Colored Troops regiment, in campaigns against the Cheyenne, Comanche, Kickapoo and Kiowa Indians in Texas. While commander of Fort Davis, he started a controversial court-martial of second lieutenant Henry Flipper, the first black cadet to graduate from West Point. In May 1897 he was appointed as a brigadier general.
Shafter was a member of the Military Order of the Loyal Legion of the United States, the Military Order of Foreign Wars and the Sons of the American Revolution.
Shafter retired in 1901 and returned to farming. He died in 1906 and is buried at San Francisco National Cemetery.