He served half of a third two-year term from 1876 to 1877 before his swearing-in as president.
In 1877, Hayes assumed the presidency following the 1876 United States presidential election, one of the most contentious in U.S. history. Hayes lost the popular vote to Democrat Samuel J. Tilden, and neither candidate secured enough electoral votes. According to the U.S. Constitution, if no candidate wins the Electoral College, the House of Representatives is tasked with selecting the new president. Hayes secured a victory when a Congressional Commission awarded him 20 contested electoral votes in the Compromise of 1877. The electoral dispute was resolved with a backroom deal whereby the Southern Democrats acquiesced to Hayes's election on the condition that he end both federal support for Reconstruction and the military occupation in the former Confederate States.
Hayes's administration was influenced by his belief in meritocratic government and in equal treatment without regard to wealth, social standing, or race. One of the defining events of his presidency was the Great Railroad Strike of 1877, which he resolved by calling in the US Army against the railroad workers. It remains the deadliest conflict between workers and strikebreakers in American history. 