In a stunning upset, Donald Trump won the presidency early Wednesday morning, as 10 electoral votes from Wisconsin put him over the required 270.

How? Trump absolutely devastated Clinton in the rural vote, which has a significant number of working class whites that had been flocking to him throughout the election cycle. And Clinton, in many cases, was not able to make up the difference in more urban areas, home to minorities and college-educated whites, whose support for Clinton was more tepid.

Precincts won by Republicans

Precincts won by Democrats

The size of the circles

represents margin of victory

in percentage points.

75

50

25

DC

Charlottesville

VIRGINIA

Richmond

Roanoke

Norfolk

Greensboro

Durham

40

85

Charlotte

Raleigh

26

Fayetteville

NORTH CAROLINA

50 miles

Data as of 5:45 a.m.

The size of the circles

represents margin of victory

in percentage points.

Precincts

won by

Republicans

Precincts

won by

Democrats

DC

75

50

25

Va.

Va.

Harrisonburg

N.C.

N.C.

Charlottesville

64

Richmond

Lynchburg

Roanoke

High margins for Trump in rural areas

Norfolk

81

VIRGINIA

85

95

Winston-Salem

Greensboro

Durham

NORTH CAROLINA

Asheville

40

85

Raleigh

Charlotte

26

Fayetteville

50 miles

High margins for Clinton in cities.

Wilmington

Data as of 5:45 a.m.

Precincts

won by

Republicans

Precincts

won by

Democrats

The size of the circles

represents margin of victory

in percentage points.

DC

75

50

25

Va.

Va.

Harrisonburg

N.C.

N.C.

Charlottesville

64

Richmond

Lynchburg

Roanoke

High margins for Trump in rural areas

Norfolk

81

VIRGINIA

85

95

Winston-Salem

Greensboro

Durham

NORTH CAROLINA

Asheville

40

Raleigh

85

26

Charlotte

Fayetteville

50 miles

High margins for Clinton in cities.

Wilmington

Data as of 5:45 a.m.

Precincts won by Republicans

Precincts won by Democrats

DC

Harrisonburg

The size of the circles

represents margin of victory

in percentage points.

Charlottesville

75

50

25

64

Richmond

Lynchburg

Roanoke

Norfolk

81

VIRGINIA

85

Winston-Salem

95

Greensboro

Durham

Asheville

NORTH CAROLINA

40

Raleigh

85

Charlotte

26

Fayetteville

50 miles

Wilmington

Data as of 5:45 a.m.

This difference between Clinton’s run and Obama’s in 2008 — when his urban support overwhelmed his weakness in rural areas — is especially clear in Virginia and North Carolina. The neighboring states show two different paths many blue-leaning states took on election night. Virginia, where polling indicated Clinton had a solid lead, delivered her a narrow victory after nearly four hours of suspense. North Carolina, where she was just barely favored in the polls, went to Trump.

[ Donald Trump wins the presidency in stunning upset over Clinton]

And both states showed this same pattern for Clinton: big losses in rural areas, compared to 2008, with little or no gain in cities to offset it. Of the approximately 5,500 precincts between the two states, over 1,000 saw the Republican vote share increase by more than 10 points from 2008. Mere dozens saw a similar shift in favor of Democrats. This, and all other results we include here, are preliminary, and in the case of precinct-level data, only reflect in-person Election Day votes.

The vote in the rural southwest region of Virginia was especially strong against Clinton. Trump was winning counties in that area with as much as 80 percent of the vote — about 15 points higher than John McCain’s vote share there. In Bland County, which was among Trump’s strongest supporters at 82 percent, McCain won with just 69 percent of the vote.

North Carolina tells a nearly identical story. Graham County in the rural, mountainous west, for example, gave Trump an 80 percent vote share but just 68 percent to McCain. Surrounding counties showed similar differences.

NORTH CAROLINA

Margin

for Dem.

Margin

for Rep.

0

+100,000

votes

Large urban

12 counties

’00 election

’08

’16

Small cities

34 counties

Rural

54 counties

Margin

for Dem.

Margin

for Rep.

VIRGINIA

+300,000 votes

+300,000 votes

0

Large urban

48 counties

Small cities

32 counties

Rural

53 counties

Va.

N.C.

Margin

for Dem.

Margin

for Rep.

Margin

for Dem.

Margin

for Rep.

+300,000 votes

0

+300,000

+300,000

0

+300,000

Large urban

12 counties

48 counties

’00 election

’08

’16

Small cities

34 counties

32 counties

Rural

54 counties

53 counties

Va.

N.C.

Margin

for Dem.

Margin

for Rep.

Margin

for Dem.

Margin

for Rep.

+300,000 votes

0

+300,000

+300,000

0

+300,000

Large urban

12 counties

48 counties

’00 election

’08

’16

Small cities

34 counties

32 counties

Rural

54 counties

53 counties

These losses can largely be explained by Clinton’s poor performance among less-educated voters. Both she and Obama got 51 percent of the vote in Virginia precincts where over a quarter of residents hold college degrees. But in the other, less-educated precincts, Clinton only received 44 percent to Obama’s 53.

[ Markets rattled by Trump’s shock victory, but stage partial recovery]

The same pattern is seen along income lines — Clinton did about as well as Obama did in Virginia precincts with a median income over $50,000, but eight points worse than Obama in the less wealthy precincts. And along racial lines, Clinton did eight points worse than Obama in Virginia’s majority white precincts.

Those disparities show a big factor in Clinton’s defeat: She made no gains among the more-educated or rich to make up for her losses.

And because of that, Northern Virginia, which is more urban, more educated and more diverse than elsewhere in the state — all favorable characteristics for Clinton — was barely enough to secure her victory. There, she performed about as well as Barack Obama did in 2008. In Loudoun County, a D.C. suburb, for instance, Clinton earned 55 percent of the vote to Obama’s 54.

[ Republicans hold on to Senate majority with upset victories]

The same trend is clear in North Carolina’s cities. In Wake County, for instance, which includes Raleigh, Clinton got 58 percent of the vote, just one point more than Obama did in 2008.

Democrat gains since last election

Republican gains since last election

Democrat gains since last election

Republican gains since last election

Democrat gains since last election

Republican gains since last election

These patterns extend far beyond Virginia and North Carolina, resulting in unexpected losses across the map. Clinton accrued only 218 electoral votes across the country, as of Wednesday morning at 2:30 a.m., soon before she conceded to now President-elect Donald Trump.

More stories

What one swing state can teach us about political polarization in America

North Carolina’s electorate, facing multiple contentious elections, is starkly divided by race, income, and increasingly, education.

These 127 counties point to the election winner

Within swing states states are counties where many voters have switched the party they support, and that could prove decisive Tuesday.