[61] Hanna came to admire McKinley and became a friend and close adviser to him. Although Hanna remained active in business and in promoting other Republicans, in the years after 1888, he spent an increasing amount of time boosting McKinley's political career.[62]
In 1889, with the Republicans in the majority, McKinley sought election as Speaker of the House. He failed to gain the post, which went to Thomas B. Reed of Maine; however, Speaker Reed appointed McKinley chairman of the Ways and Means Committee. The Ohioan guided the McKinley Tariff of 1890 through Congress; although McKinley's work was altered through the influence of special interests in the Senate, it imposed a number of protective tariffs on foreign goods.[63]

Gerrymandering and defeat for re-election
Recognizing McKinley's potential, the Democrats, whenever they controlled the Ohio legislature, sought to gerrymander or redistrict him out of office.[64] In 1878, McKinley was redistricted to the 16th congressional district; he won anyway, causing Hayes to exult, "Oh, the good luck of McKinley! He was gerrymandered out and then beat the gerrymander! We enjoyed it as much as he did.