A voting sign is seen outside the Rock Dam Rod and Gun Club in Foster Township, Wis., on Nov. 6, the day of the 2018 midterm elections. (Nick Oxford/Reuters)

When President Trump won the White House in 2016, he did it by hijacking the Republican Party. Now, after what happened in the midterm elections, it’s clearer than ever that the president’s fortunes and his party’s future are at odds.

During the final weeks of the fall campaign, Trump put the Republican Party on his back, ensuring that the elections would become even more of a referendum on his performance than the typical midterms in a president’s first term. As a result, Republicans paid a hefty price, with potentially longer-term implications.

Yes, Republicans added to their narrow majority in the Senate. But that came by reinforcing what already is the party’s greatest strength: Trump with his rallies maximized support in solid red states, especially among voters in rural areas and small-town communities.

But the Trump-centric strategy backfired spectacularly in the race for control of the House, as suburban voters revolted against the president, delivering a rebuke to his party’s candidates in district after district. Democrats have gained 39 seats in the House with the possibility of hitting 40 depending on the outcome of the still uncalled election in California’s 21st District.

If the enthusiasm for Trump in rural and small-town America constituted the story after 2016, the revolt against him in the suburbs, led by female voters, has become the story of the 2018 elections. The more you analyze the House results, the more the GOP’s suburban problem stands out.

One way of looking at the House results is by the population density of congressional districts. CityLab places congressional districts on a continuum of six categories, ranging from “pure rural” to “pure urban.” In between are four categories of suburban districts, from less dense to more dense.

Take the 11 most rural districts that were on the competitive lists assembled by the Cook Political Report ahead of the election. Going into the election, Republicans held nine of the 11. When the new Congress assembles in January, they will still hold eight of the 11.

GOP losses in the next category, what are called suburban-rural districts, were also modest. Seven of 19 districts in this group changed parties: five shifting to the Democrats and two to the Republicans. Republicans had 17 of these districts going into the election and will end up with either 13 or 14 in the new Congress.

But the damage grows exponentially in the next two categories. There were 30 districts categorized as suburban-sparse. Heading into the election, Republicans held every one of them. As a result of the election, Democrats will have 16 to the GOP’s 14.

In the 15 districts described as suburban-dense, something similar happened. Republicans held all 15 before the election. In January, they will have control of just three. In the nine districts categorized as urban-suburban, Republicans will go from holding seven to holding just one.

Democrats made big gains in 12 districts held by Republicans that were won by Hillary Clinton in 2016 and Barack Obama in 2012, flipping nine of them. In another 13 districts won by Clinton in 2016 and by Mitt Romney in 2012, Democrats flipped another 12.

Democrats also converted eight of 12 districts that Trump won in 2016 but that Obama had won in 2012. Republicans did better in the districts won by Trump in 2016 and Romney in 2012, which constituted more than half of all the competitive districts, but Democrats still managed to convert nearly a third of them.

California delivered the most significant blow to the Republicans. The party there has been in a long decline, and Trump’s presidency has made things worse. Democrats will pick up at least six seats in California, with a seventh possible. The lone competitive seat that remained in GOP hands was that of Rep. Duncan D. Hunter, who is under indictment on allegations of making personal use of campaign funds.

House Majority Leader Kevin McCarthy (R-Calif.) has closely allied himself with the president, and he was among those who pushed to include an initiative on the fall ballot to repeal a state gasoline tax increase that the California legislature approved to fund repairs of roads and bridges.

McCarthy hoped the repeal initiative would spur Republican turnout and thereby protect some of his party’s endangered seats. Instead, by a 55 percent majority, the initiative was defeated. Rural voters supported it; urban voters opposed it. That vote in microcosm was one more example of the urban-rural divide that is now one of the most defining features of current politics.

Republican strategist Bruce Mehlman produced a set of charts analyzing the 2018 election, including one showing various fault lines within the electorate. They include divisions based on race, age, gender, education and geography. Race — whites vs. nonwhites — remains the biggest divide of all. But geography is by far the fastest growing, and now the urban-rural divide is almost as wide as the divide between whites and nonwhites.

That political division can still work to Trump’s advantage as he looks to his reelection campaign, as an analysis of the gubernatorial results in Wisconsin in 2018 and 2014 by Craig Gilbert of the Milwaukee Journal Sentinel illustrates. Gilbert found Republican Gov. Scott Walker, who was narrowly defeated in his bid for a third term, lost ground in the 35 most populous counties in the state, but he gained ground in 16 of the 20 least populous counties.

Given the closeness of the results in the governor’s race, that analysis suggests Trump can still win states like Wisconsin by running up his margins in rural areas. It is the strategy he probably will pursue in 2020 as he seeks to hold onto the states that delivered the presidency for him.

But Trump’s appeal — rhetoric about “America First,” law and order, closing the border and attacks on immigrants — brought a rebuke from voters in the suburbs. This fall, Republican candidates throughout the country found themselves tethered to Trump, sometimes by choice, sometimes when they tried to distance themselves. Trump became the drag that brought many of them down.

The House will be up for grabs again in 2020, as about half of the roughly 80 most competitive races were won by five points or fewer, split about evenly between the two parties. For Democrats, maintaining their new majority will require replicating the energy, enthusiasm and anti-Trump fervor that powered them to victory in November. For Republicans in those suburban districts in Democratic hands, it will mean trying to insulate themselves from that anti-Trump sentiment more successfully than they did this fall. No small task.