William Hays ( general ) William Hays ( May 9 , 1819 – February 7 , 1875 ) was a career officer in the United States Army , serving as a Union Army general during the American Civil War . Early life . Hays was born in Richmond , Virginia , but moved to Nashville , Tennessee . Andrew Jackson appointed Hays to the United States Military Academy , where he graduated in 1840 alongside William T . Sherman and Richard S . Ewell . He as initially a brevet second lieutenant , and was promoted to first lieutenant in 1847 , serving at various posts in the northeastern states . He served throughout the Mexican - American War with the light artillery , alongside future Civil War artilleryman Henry J . Hunt . He was wounded at the Battle of Molino del Rey , and was subsequently appointed a brevet captain for Contreras and Churubusco and major for Chapultepec . From 1853 ( when he was promoted to captain ) until 1854 , he was engaged in the Seminole Wars in Florida , and was on routine frontier duty in 1856 – 60 in the 3rd and then the 5th U . S . Artillery . Civil War . As a lieutenant colonel , Hays commanded a brigade of horse artillery under Henry Hunt in 1861 – 62 in the Army of the Potomac , serving with distinction at the Battle of Seven Pines during the Peninsula Campaign . He participated in the Battle of Antietam , where he commanded the V Corps Reserve Artillery . His batteries were stationed on the heights east of Antietam Creek , providing long range fire against Confederate infantry positions between the East and West Woods . He commanded the artillery of the Right Grand Division at Fredericksburg . Hays was appointed brigadier general of volunteers in November 1862 and assigned command of an infantry brigade in Maj . Gen . William H . French ' s division in the II Corps . He was wounded and taken prisoner at Chancellorsville on May 3 , 1863 , along with all but one of his immediate staff . Hays was exchanged on May 15 , 1863 , and sent to Fort Monroe in Virginia . Although without an official command , he rejoined the Army of the Potomac and accompanied it to Gettysburg , Pennsylvania . During Pickett ' s Charge on July 3 , Maj . Gen . Winfield S . Hancock was severely wounded but refused to leave the field until the battle had been decided . When it became clear the Confederate charge had been defeated Hancock relinquished command temporarily to his 1st Division commander , Brig . Gen . John C . Caldwell . Later that evening , Hays ( although still a brigadier general and junior in rank to Caldwell ) , was assigned to command the II Corps . He led the corps throughout the summer until permanent command was given to Maj . Gen . Gouverneur K . Warren in mid - September . In November , Hays was appointed provost marshal of the southern district of New York , and was also promoted to major in the regular army . At the expiration of his term in February 1865 , Hays rejoined the Army of the Potomac at Petersburg and served again in the II Corps , this time commanding the 2nd Division . He was appointed a brevet brigadier general in the regular army on March 13 , 1865 , for gallant conduct , but on April 6 he was relieved of command for sleeping on duty , and his brevets were revoked . ( Brig . Gen . Francis C . Barlow was given the division instead . ) From that date , Hays commanded the Artillery Reserve of the Army of the Potomac until he was mustered out of volunteer service in January 1866 . Later life . Reverting to his permanent rank of major of the 5th U . S . Artillery , Hays served on various posts , commanding Fort Independence in Boston Harbor from April 1873 until his death there almost two years later . He was buried in Yonkers , New York , but was re - interred at West Point Cemetery in 1894 .