When the first batch of results were announced soon after Florida polling stations closed, the situation looked good for Hillary Clinton. She seemed to be performing better than expected in Democrat-friendly counties like Broward, Miami-Dade and Palm Beach, indicating that her high levels of Hispanic support were cancelling out Donald Trump's gains in rural, whiter areas of the state.
But as the night wore on, the situation in the Sunshine State started to look less certain. Whilst Clinton was performing as well as expected in urban counties, Trump was breaking records of his own to keep the race a tight affair. Clinton's share of the vote in Broward, Miami-Dade and Palm Beach largely mirrored Obama's four years ago, but away from the main cities, she was struggling to keep up with Trump. In Monroe County, which Barack Obama narrowly won by 0.4% of the vote in the last election, Trump ended up winning by 6.9%, whilst in St. Lucie - an area that not only voted Democrat in both 2008 and 2012 but had done so in every election since 1996 - a 7.8% lead was wiped out by the Republican nominee.
Unsurprisingly, both counties are overwhelmingly white, and their results highlighted a trend that would continue throughout the course of the night and, eventually, result in the most unexpected of victories for Trump.
Heading into the election, a lot of fuss was made about Florida. One of the key states that Trump had to win to have a chance of becoming president, the swing towards Trump left many Clinton supporters feeling understandably nervous. And whilst their fears would later be vindicated when Trump was eventually announced as the state's victor, Clinton never needed to win there to secure the presidency.
However, her struggles in rural, whiter areas of Florida gave an early indication as to how other battleground states might pan out, and as the night wore on and Trump's electoral college votes piled up, Clinton's hopes suddenly lay with three hotly-contested and predominately industrial states: Michigan, Pennsylvania and Wisconsin.
If Clinton's losses in Florida were damaging then her performance further north was catastrophic. Pennsylvania's Erie County, an area containing old industrial towns that Obama had comfortably won by 16.9% four years ago, voted for Trump, whilst Luzerne County resulted in an unexpected Republican landslide as the party's nominee won 58.4% of the vote, despite the fact that Obama won by 4.9% in 2012. Before this year, the Republicans had won in the county on just three occasions since Richard Nixon's landslide victory in 1972, and only that win compares to the extraordinary gains made by Trump.
Even when Clinton was winning, it wasn't good enough. Lackawanna County, which includes the industrial city of Scranton, voted for Clinton but only by 3.4%, a lacklustre result compared to the double-digit thrashing of Mitt Romney that Obama enjoyed four years earlier.
It was a similar story in Wisconsin, another state with a large population of white, working-class and Democrat-leaning voters that had been enthused by Trump's populist message. Obama's 6.7% victory over Romney came thanks to the president winning 34 of the state's 72 counties. Clinton managed to win just 13. A large swathe of blue that had run from Dunn County in the northwest to Rock County in the south was almost entirely wiped out. Monroe County, which four years ago stood as a lone block of red in a sea of blue, is now bordered by just one Clinton-supporting county; the rest have shifted their allegiance to Trump.
During the campaign, a lot of column inches focused on the white working-class voters that had traditionally supported the Democrats but, fuelled by anxiety and anger over issues such as globalisation and immigration, found themselves attracted to Trump's populist and nativist message.
In the run-up to the election, MSNBC's Joe Scarborough argued, as many other commentators and political scientists did, that "there are not enough white voters in America for Donald Trump to win whilst getting routed amongst minorities". It was generally believed that Trump-supporting non-Hispanic whites (an ethnic group whose numbers continue to decrease) would be cancelled out by Hispanic and black voters, the majority of whom, according to opinion polls, were planning to back Clinton.
But, as has now been established, pre-election polling was deeply flawed and underestimated Trump's level of support, particularly in the industrial, working-class areas of the Midwest where a swing of just a few percent towards the Republican nominee was enough to win him key states and, ultimately, the presidency.
In the coming weeks, much will be said about the election as data is examined and things start to make more sense, but for now it seems clear that, in the end, the white working-class voters that were the focus of so much pre-election discussion swung the election in favour of Trump. Clinton proved unable to counter her opponent's populist rhetoric with a positive and inspiring message, resulting in working-class whites drifting even further away from the Democrats.
With Trump in the White House and the Democrats out of power for at least four years, the latter now need to formulate a strategy to win back the voters that have deserted them. If they don't, whoever stands in 2020 runs the risk of making the same costly mistakes as Clinton.