Early on the morning of Nov. 9, Republican President-elect Donald Trump addressed supporters in New York, declaring victory over Democrat Hillary Clinton. Here are key moments from that speech. (Sarah Parnass/The Washington Post)

Donald Trump outperformed the previous Republican presidential nominee, former Massachusetts governor Mitt Romney, in areas of the country with large numbers of white voters, leading to a far tighter race Tuesday night than many had expected leading into Election Day.

The composition of the 2016 electorate was similar to that of the 2012 voting population, according to preliminary exit poll data. But Trump performed exceptionally well among white voters, while Clinton did less well among nonwhite voters than fellow Democrat President Obama did four years ago.

In general, a pattern took hold across a number of key battleground states: In some counties where Obama won, Clinton won as well — but often by significantly less. Where Romney won, Trump won, too — but his margins were much bigger.

The result was a nail-biter of a race in which Trump’s advantage grew by the hour. For example, Clinton merely eked out a win in Virginia, a state that Obama won comfortably four years ago. And she was defeated in the all-important battleground of Florida.

Vowing that there would be more to say later, John Podesta, chair of Hillary Clinton's presidential campaign, asked supporters to wait until more votes had been counted. Podesta spoke shortly after 2:00 a.m. on Nov. 9. Clinton did not appear. (The Washington Post)

With some votes still left to count late Tuesday, Trump was also ahead in states with large white populations, such as New Hampshire and Wisconsin and Michigan.

Among nonwhite voters, Clinton led Trump by 54 points, a whopping advantage but one that was significantly smaller than Obama’s 61-point margin among nonwhite voters four years ago, according to preliminary exit poll data.

Trump, meanwhile, earned the votes of 60 percent of white men and 52 percent of white women. And he consolidated the GOP coalition, bringing Republicans home in the final weeks of the campaign. The exit poll data indicate that he won 88 percent of Republican votes cast and 78 percent of ballots cast by white evangelicals.

That pattern produced compelling results in Florida, which Obama won in 2012. Trump outperformed Romney’s levels of support in 51 of the state’s 67 counties. Clinton, meanwhile, outperformed Obama in just six counties.

Trump’s strength came in rural areas long considered likely to support his bid, but also in more suburban areas, including around Tampa and St. Petersburg, where Clinton was thought to have a significant edge.

The area around Tampa was particularly telling: In 2012, Obama won Hillsborough County with 52.7 percent of the vote and nearby Pinellas County with 52.1 percent. On Tuesday, Clinton led in Hillsborough with 51.5 percent of the vote, slightly less than Obama. But she lost Pinellas County with 47.5 percent of the vote. Both counties are predominantly white, with non-Hispanic whites making up three-quarters of the population in Pinellas County, according to census data.

In counties across Florida that are at least three-quarters white, Clinton underperformed Obama by an average of nearly five percentage points. Meanwhile, in counties that were less than 60 percent white, she underperformed him by 2.5 percentage points.

The pattern was even more pronounced in Ohio, which was a pivotal presidential battleground in the past three election cycles, and where Trump won by nearly nine points.

Leading into Tuesday, Ohio seemed to lean consistently toward Trump, thanks largely to a population that includes a larger percentage of non-college-educated white voters than in most other parts of the country. Such voters tended to break heavily for Trump and formed the core of his base. In Ohio, several heavily industrial ­areas responded positively to Trump’s anti-free-trade message.

Late Tuesday, Trump won by landslides in two heavily white counties — Ottawa and Sandusky — that Romney lost by single digits four years earlier. Ottawa County, along the southwest shore of Lake Erie, boasts a population that is about 97 percent white, while neighboring Sandusky County is 94 percent white, according to census estimates.

In Ottawa, Trump beat Clinton, 57 percent to 37 percent. In Sandusky, Trump’s margin was even greater — 58 percent to 35 percent.

In North Carolina, another key battleground state, Trump benefited from an uptick in turnout in the rural areas, including the western third of the state where manufacturing losses have taken a big toll and in the east, where tobacco was once king.

The state has historically been favorable turf for Republicans in presidential races. Obama won there narrowly in 2008 but lost by a close margin to Romney in 2012. Trump defeated Clinton by four points.

Democrats were banking this year on a longer-term trend that they believed was working in their favor in the state: an influx of white, college-educated professionals in the urban and suburban corridor that stretches from Raleigh to Charlotte. They also were counting on an uptick in African American voters — a legacy of Obama’s campaigns.

Early voting among African Americans was down, however, attributed in part to a reduction in the times and polling places open for early voting.

In Michigan, another must-win state for Clinton that has gone for Democrats in recent election cycles, partial returns showed Clinton winning Wayne County, home to Detroit, but by a smaller margin than Obama garnered in 2012. Meanwhile, Trump was crushing Clinton in many rural counties by nearly 2-to-1 margins.

Despite early reports of a surge in Hispanic voting, the percentage of the electorate that was Hispanic appeared to closely match that of the 2012 electorate, according to preliminary exit poll data.

Likewise, while women generally vote in higher numbers than men, they did not appear to expand their share of the electorate this year, despite the chance to elect the nation’s first female president.

There were signs, however, that voters on balance were rejecting Trump’s core message on immigration. The data showed about 7 in 10 voters said that most undocumented immigrants should be given a chance to apply for legal status. Trump called for deporting all those in the country illegally, a position backed by only a quarter of voters in the preliminary exit poll data. A majority also opposed Trump’s signature proposal to build a wall on the southern border of the United States.

Emily Guskin and Claudia Deane contributed to this report.