The young attorney plunged into politics almost immediately, working for Hayes in the gubernatorial campaign of 1867 and for Grant in the presidential campaign of 1868. McKinley's service to the Republican party brought its initial reward with his election as prosecuting attorney of Stark County in 1869, and for the rest of his life he was either campaigning for public office or carrying out the duties of public office. In 1877, having served his political apprenticeship, he entered Congress from the seventeenth Ohio district. His long tenure in the House of Representatives, interrupted only by his being temporarily unseated after a close election in 1882, was to last until 1890, when he was defeated as a result of the gerrymandering of his district. McKinley returned home to enter the Ohio gubernatorial race in 1891. Elected by a comfortable margin, he won reelection in 1893 with an overwhelming majority.
Despite occasional setbacks, McKinley fared well in the politics of Ohio, a key state for anyone seeking national prominence. With its strategic location, industrial growth, and population expansion, Ohio provided a setting in which the forces shaping modern America could be observed in microcosm. The characteristics that made it a bellwether state imposed unusual demands on political leaders. Having to satisfy northerners and southerners, immigrants and American-born, Catholics and Protestants, laborers, industrialists, and farmers—in short a diversity of economic and cultural interests—a politician in Ohio could seldom afford the luxury of campaigning on a single issue. To become successful in politics required transcending limited causes and defining attainable objectives for a complex, protean society. No one ever performed that service for the state better than did McKinley, and by espousing a form of benign economic nationalism, he appealed to a broad range of interests in the nation as a whole.
The stand McKinley took on issues important to his constituency was never determined by economic considerations alone. Neither was he motivated solely by a desire to win votes. McKinley was a decent, honorable man who genuinely respected people and took pleasure in working with them. To the delight of cartoonists, he resembled Napoleon. His facial features and his sturdy frame were, in fact, strikingly like those of the emperor, but even his harshest critics could find in his manner little that was autocratic or imperial. He carried himself with a decorum that did not interfere with his sensitivity to human need.
The traits of character that attracted nearly all who had personal dealings with McKinley were severely tested early in his career. In 1871 he married vivacious Ida Saxton, whose father was one of Canton's leading bankers, and within a year the couple announced the birth of a daughter, Katherine. Awaiting the arrival of their second child in 1873, the McKinleys suffered a reversal of fortune. Ida's mother died, the young wife underwent labor in a state of extreme grief, and there were complications. The infant lived less than a year. Then, to compound McKinley's anguish, little Katie died of typhoid fever a few months later, and Ida was never again to enjoy good health.
Politics proved therapeutic for McKinley, and he devoted himself wholeheartedly to them. Yet he remained attentive to his wife's needs, and his humanitarian concern repeatedly led him to identify with persons in difficulty. At the time of his daughter's death, the nation was undergoing an economic depression resulting from the Panic of 1873. The hard times brought a profound social unrest that often gave way to violence.
Disturbances developed close to home when, in March 1876, coal miners in the Tuscarawas Valley struck for higher pay and better working conditions. Mineowners responded by bringing in strikebreakers from Cleveland, a move that incited the miners to riot. Local authorities were unable to keep the peace, Governor Hayes called out the militia, and a group of miners was arrested for disorderly conduct. Upon hearing of the miners' troubles, McKinley took up their cause. In a well-prepared legal defense, he argued that, had the operators been reasonable, no strike would have occurred. His persuasiveness secured the acquittal of all but one of the strikers and, characteristically, he accepted no fee for his services. The workers never forgot, and in his political campaigns McKinley could always count on significant support from labor.