The presidency of Rutherford B. Hayes began on March 4, 1877, when Rutherford B. Hayes was inaugurated as President of the United States, and ended on March 4, 1881. Hayes became the 19th president, after being awarded the closely contested 1876 presidential election by Republicans in Congress who agreed to the Compromise of 1877. Congress overrode his veto, but Hayes's monetary policy forged a compromise between inflationists and advocates of hard money. While reform legislation did not pass during Hayes's presidency, his advocacy provided the 'political impetus' for the 1883 passage of the Pendleton Civil Service Reform Act. In 1868, the Senate had ratified the Burlingame Treaty with China, allowing an unrestricted flow of Chinese immigrants into the country. As the economy soured after the Panic of 1873, Chinese immigrants were blamed for depressing workmen's wages. During the Great Railroad Strike of 1877, anti-Chinese riots broke out in San Francisco, and a third party, the Workingman's Party, was formed with an emphasis on stopping Chinese immigration.