WASHINGTON — Donald Trump was shunned by much of the Republican establishment, but he forged a message of economic grievance and political change that resonated with white voters in rural areas and small towns.

Early Wednesday morning, the political novice who was taken seriously by almost no one when he announced his presidential bid 16 months ago won the White House over Democrat Hillary Clinton, the final stunning turn in a campaign that defied one conventional wisdom after another.

With a signature pledge to "make America great again," Trump managed to run up a huge margin in counties that have voted Republican in every election since 2000. He was winning those counties by 66%-30%, a margin of 36 percentage points. In 2012, Mitt Romney had carried them by 29 points.

But Clinton didn't make similar gains in traditionally Democratic counties. She was winning in those by 66%-31%, the same margin that Obama had carried them four years ago.

The long, contentious and sometimes ugly campaign deepened divides by geography, gender and education. New coalitions were emerging that could roil the two major parties and reverberate in American politics for a generation.

Clinton's Democratic coalition included overwhelming support from African-Americans and a wide margin among Latinos, plus the backing of a majority of white college-educated women and the affluent — voters that used to be Republicans. Trump's Republican coalition was almost entirely white and included a crushing margin among men without a college education — the sort of working-class guys who used to be Democrats.

They were battling for votes in a nation that was downbeat about their leaders and, for some, their lives.

n exit polls by Edison Research, more than three in five voters said things in this country had gotten "seriously off on the wrong track." Among those voters, 69% supported Trump, 25% Clinton. Nearly a quarter of voters described themselves as “angry” about the way federal government is functioning. They were at the core of Trump’s support.

Only a bit more than a third predicted life for the next generation would be better than today, the fundamental tenet of the American dream.

Optimism and enthusiasm was in short supply.

The most common reaction among Trump supporters to the idea of Clinton's election was "scared;" that was also the most common reaction among Clinton supporters to the prospect of Trump's election. Fewer than half of voters said they strongly favored their own candidate; four years ago, two-thirds had. Only one voter in 50 viewed both candidates as trustworthy; nearly one in three voters said neither was.

That wasn't exactly a prescription for a political honeymoon.

Historians and political scientists struggled to cite a precedent for a contest so defined by division and attack. The dominant message from each candidate was that the other couldn't be trusted with the keys to the White House.

"You'd have to go back to Burr-Hamilton in the Weehawken duel," said New York Rep. Steve Israel, an eight-term Long Island Democrat who is retiring. (History class reminder: In 1804, then-vice president Aaron Burr mortally wounded former Treasury secretary Alexander Hamilton.)

Trump's election was groundbreaking. At 70, he will be the oldest president ever elected, and the first to have had no experience in government or military command.

He defeated another groundbreaking candidate. The former secretary of State was the first woman nominated for president by a major party in the 240-year history of the republic.

Sixteen months ago, they launched their candidacies within days and a mile of one another, at Trump Tower and on Roosevelt Island. Here's a look at what happened in their final showdown Tuesday, and why.

Blue-collar whites turned red

There was a time when white men without a college education — men who worked with their hands, including those in unions — were a backbone of the Democratic coalition FDR forged.

But this year, they gave Trump his most avid support, embracing his message that unwise trade deals and competition for jobs from illegal immigrants had cost them their place in the middle class. They backed him by more than 3-1, 72%-23%.. While Clinton was endorsed by the leadership of most labor unions, voters from union households backed her only narrowly.

In an analysis of counties where the most people work in manufacturing, Trump was leading by an overwhelming 70%-26%. He was winning by another huge margin, 60%-37%, in the 121 reporting counties with the highest rates of unemployment.

With that, he cracked the so-called "blue wall" of reliably Democratic states across the industrial Midwest.