Throughout this election cycle, FiveThirtyEight and others wondered where Democrats could pick up House seats: Would it be in the 13 districts that Mitt Romney carried in 2012 but Hillary Clinton won in 2016? Or would it be in the 21 districts that Barack Obama carried in 2012 but Donald Trump won in 2016? It turns out that both types of districts mattered, and as Nathaniel Rakich noted, Democrats scored big in Romney-Clinton districts (and they may still gain more ground there, as not all races in California have been called).

But arguably what mattered more than a district’s presidential choice in 2012 and 2016 was whether it was suburban. Democrats made huge gains in Romney-Trump seats, too — we’re looking at you, Oklahoma 5th. Seats that leaned Republican but weren’t in rural areas proved to be pretty big pickup opportunities for Democrats and may be part of a larger story on the growing divide between urban and rural America.

Before the election, I wrote that Democrats could get close to a majority in the House by winning seats in areas of the country that were mostly suburban. And as we saw on Election Day, that strategy worked. In fact, Democratic gains in suburban areas (coupled with the party holding on to its urban seats) were enough to give Democrats a majority, and they are now en route to an overall seat gain in the mid-to-high 30s.

So how exactly did the suburbs help make a Democratic majority possible? Using CityLab’s neighborhood density categorizations, we can place all 435 districts into six groups that range from “Pure Rural” to “Pure Urban” and get a sense of which types of seats mattered most to Democrats. The two categories we’re most interested in are “Sparse Suburban” and “Dense Suburban.” “Sparse Suburban” covers districts in outer-ring suburbs at the edge of major metropolitan areas, like the Virginia 10th, which sits outside of Washington, D.C. “Dense Suburban” districts, on the other hand, are those where people are packed in more tightly in mostly inner-ring suburbs and some urban areas, like the California 25th, which falls in the Los Angeles metro area. And as the table below shows, Democrats are poised for a net gain of 27 seats from these two categories, which is four more than they needed to gain a majority. In other words, 75 percent of Democrats’ gains came from these predominantly suburban districts.

A blue wave swept through the suburbs Number of House seats gained by Democrats in the 2018 election, by the density of neighborhoods in each district Before After CityLab Category Dem. Seats GOP Seats Dem. Seats GOP Seats TBD Dem. pickups Share of Dem. pickups Sparse Suburban 35 51 50 35 1 +15 42% Dense Suburban 56 27 68 15 0 +12 33 Urban-Suburban 41 7 46 1 1 +5 14 Rural-Suburban 21 93 24 90 0 +3 8 Pure Urban 33 1 34 0 0 +1 3 Pure Rural 9 61 9 60 1 0 0 Total 195 240 231 201 3 +36 100 Seat totals are derived from races where ABC has projected a winner as of 8:30 a.m. on Nov. 8, 2018. In races where no winner has been projected, the seat is counted as going to the party that is favored to win in FiveThirtyEight’s live midterm forecast. Three districts — CA-45, ME-2 and NJ-3 — were excluded because no winner has been projected and the forecast gives each party an equal chance of winning. Source: CityLab

In addition to doing well in the two predominantly suburban categories, Democrats also grabbed eight seats in the two other categories with some suburban characteristics: five in the more densely populated “Urban-Suburban” category and three in the less densely populated “Rural-Suburban” group. And Democrats have nearly eliminated the GOP from the “Urban-Suburban” group, leaving only Rep. Mario Diaz-Balart in the Florida 25th, at least for now — Republican Rep. Mimi Walters could still hold on to the uncalled California 45th, which is also in the “Urban-Suburban” group.

But where things get really interesting is when we look at how these districts voted for president in 2012 and 2016 alongside their neighborhood characteristics. Of the 27 Democratic gains in predominantly suburban districts, nine came from Romney-Clinton districts. And while it is certainly notable that Democrats captured nearly all of the Romney-Clinton seats, the group of suburban seats that provided the largest share of Democratic gains were actually Romney-Trump seats. Democrats gained a net of 12 such seats, including flipping 10 predominantly suburban districts. That should not come as a total surprise — after all, there are 207 Romney-Trump districts compared to 13 Romney-Clinton districts. Still, the Romney-Trump seats have been consistently more GOP-leaning in recent years and are therefore harder for a Democrat to pick up.

Democrats gained seats in all kinds of suburbs House seats gained by Democrats in 2018 by how the districts voted in previous presidential elections and how densely populated they are Net Seats Dems gained in districts that voted for … CityLab Category Obama-Clinton Obama-Trump Romney-Clinton Romney-Trump Sparse Suburban +4 +2 +3 +6 Dense Suburban +2 0 +6 +4 Urban-Suburban +3 0 +2 0 Rural-Suburban 0 +1 0 +2 Pure Urban 0 +1 0 0 Pure Rural 0 0 0 0 Total +9 +4 +11 +12 Share of gains 25% 11% 31% 33% Seat gains are derived from races where ABC has projected a winner as of 8:30 a.m. on Nov. 8, 2018. In races where no winner has been projected, the seat is counted as going to the party that is favored to win in FiveThirtyEight’s live midterm forecast. Three districts — CA-45, ME-2 and NJ-3 — were excluded because no winner has been projected and the forecast gives each party an equal chance of winning. Source: CityLab

In Obama-Clinton districts (which are, of course, fairly blue), the GOP held 12 of the 194 total seats before the midterms; now they hold just three. Democrats picked up six such seats in predominantly suburban districts, and the other three in Urban-Suburban districts, which, as we mentioned earlier, are now almost entirely controlled by Democrats. And of the Obama-Trump districts that fell into one of the four at least partly suburban categories, Democrats had a net gain of three seats, with one race (the New Jersey 3rd) still undecided. Interestingly, the Democrats also managed to pick up one “Pure Urban” seat in an Obama-Trump district: the New York 11th. Republican Rep. Dan Donovan unexpectedly lost the seat to Democrat Max Rose in the last remaining densely urban GOP-held district.

The one category where Democrats made no net gains — at least as of writing this — was in “Pure Rural” districts. Democrats picked up one such district, the New York 19th, but also lost the Minnesota 8th to the GOP. However, it’s still possible that Democrats could pick up the Maine 2nd, which is one of the districts where our model gives each party a 50 percent chance of winning and where results are too close for ABC to project a winner.

Democrats won the House by capturing districts all over the country, but their gains were greatest in districts that are predominantly suburban or at least have some suburban characteristics. This meant major gains in seats where voters’ presidential choice flipped from Republican in 2012 to Democratic in 2016, but also in seats where the GOP won in both presidential cycles. In the end, the suburbs — of varying political stripes — combined to put Democrats over the top, and it’ll be interesting to watch how this growing urban-suburban coalition governs.