<Li> Battle of South Mountain (WIA) </Li> <Li> Valley Campaigns of 1864 </Li> <P> Rutherford Birchard Hayes (October 4, 1822--January 17, 1893) was the 19th President of the United States (1877--81). He became president at the end of the Reconstruction Era of the United States through a complex Compromise of 1877 . As president he ended Army support for Republican state governments in the South, promoted civil service reform, and attempted to reconcile the divisions left over from the Civil War and Reconstruction . </P> <P> Hayes, an attorney in Ohio, was city solicitor of Cincinnati from 1858 to 1861 . When the Civil War began, he left a fledgling political career to join the Union Army as an officer . Hayes was wounded five times, most seriously at the Battle of South Mountain . He earned a reputation for bravery in combat and was promoted to the rank of brevet major general . After the war, he served in the Congress from 1865 to 1867 as a Republican . Hayes left Congress to run for Governor of Ohio and was elected to two consecutive terms, from 1868 to 1872, and then to a third term, from 1876 to 1877 . </P>

What agreement led to the withdrawal of federal troops from the south
find me the text answering this question