People said Donald Trump would not, could not, happen.
Those who analyze and practice politics - most of them, anyway - said there was no way a nation that had twice elected President Obama would choose a successor who had been a leader of the "birther" movement undermining the legitimacy of the first black president.
Obama enjoys a high approval rating, 58 percent in some recent polls, a marker that usually suggests a degree of voter satisfaction. It was interpreted as a good sign for Democrat Hillary Clinton, running in effect for the incumbent's third term.
And aren't demographics destiny? Experts have pointed for years to growing minority groups, particularly Hispanics, and the inevitability of a majority-minority nation; the white share of the electorate has been falling steadily for decades.
Yet Trump won on the strength of a base of white working-class voters, and his campaign included themes of racial resentment, both overt and subtle, that appealed to some supporters feeling under siege by increasing globalization and multiculturalism.
The developer and reality-TV star vowed to smash the political and business elites that he sees as pushing job-killing free-trade deals and "political correctness." That message resonated with enough voters to build a winning coalition for Trump.
Elections are complex, and there are multiple chains of cause-and-effect that could explain why Trump upended expectations so soundly. The factors will be studied for years. Here are some early attempts at explanation.
Change vs. More of the Same. Obama's likability obscured dissatisfaction and a deep hunger for change. Persistent and large majorities of voters have in polls raised the concern that the country is on the wrong track, but many analysts, including Clinton campaign strategists, assumed that the presidential approval rating was the more meaningful predictive statistic because it had always correlated with the odds of an incumbent party maintaining control of the White House.
"There was a movement that was forming that had been building for decades, a backlash against economic and cultural globalism," said Republican strategist Bruce Haynes, cofounder of the firm Purple Strategies in Washington. Voters, he said, wanted change.
"The personification of that change was not as important as change itself," Haynes said, and Clinton was the status quo.
After all, just 38 percent of voters in exit polls said that Trump was qualified to be president, which means about one in five of the voters who pulled the lever for him did so while thinking him not ready for the job.
What we have here is a failure to communicate. It was easy to find attendees at Trump rallies all over the country who acknowledged their candidate's imperfection, but said it was important to shatter the system or, in a phrase that caught on in the last days of the campaign, to "drain the swamp" of Washington.
"There is this disconnect. It's palpable," said David Dunphy, a Philadelphia-based Democratic strategist. "People felt nobody was listening. I always believed they would reject Trump as a person, on the basis of his character, but I was wrong."
The political and media classes were stunned that anybody would believe Trump's outlandish promises, claims, and attacks - to build a border wall with Mexico and get Mexico to pay for it, for example, or that he knew more than the generals about how to wipe out the Islamic State.
Conservative columnist Salena Zito of the New York Post argued that most Trump supporters were not fooled. She wrote that the media took Trump literally, but not seriously. His loyalists took him seriously, but not literally.
"I'm not voting for his character," Mike Straub, 34, a union painter from Bensalem, said Tuesday. "I don't agree with a lot of things he says. I don't think this is how he's going to be if he becomes president."
Straub, a registered Republican, liked Trump's plan to tax products shipped to the United States by companies that move jobs overseas. He doesn't believe that the mogul can wave a wand and restore the nation's manufacturing base overnight, but says Trump's policies could slow the flow of jobs out of the country.
Jennie Stevens, 45, a Trump supporter and volunteer in Springfield, Ohio, said recently that she was not alarmed by his bellicose words.
"Is he going to go nuke somebody? No, he's not," Stevens said. "I know that."
Instead, she said, she understands the tough talk as symbolic of the idea that Trump will stand up for the U.S. abroad more than Obama.
Pendulums swing. Craig Shirley, a conservative political consultant and respected biographer of President Ronald Reagan, said there was a similar "dynamic" in Reagan's and Trump's victories: Both were outsiders, despised by Washington elites initially as boobs.
"There is a populist dialectic to American history," Shirley said in an interview. "Every generation and a half, there's an uprising."
In 1800, it was Thomas Jefferson, he said. Later in that century, came Andrew Jackson, and eventually Theodore Roosevelt, FDR, and Ronald Reagan in 1980.
"Each of them stands against the corrupting influence of bigness, sometimes of government, sometimes of corporations," Shirley said. "Conservatism is about expanding individual freedom against that bigness, that power." Trump spoke against both big government and private special interests in his campaign.
Polling blew it. A major reason the Trump win was such a shock is that polling just before Election Day, as well as analysis of the data from early voting, indicated Clinton was favored to win. Even a statistical model prepared for the Trump campaign by the Republican National Committee predicted he would fall short.
It will take a while for the polling industry to figure out and adjust to what went wrong. One possibility is "confirmation bias," the idea that people give greater weight to information that confirms already held beliefs, leading analysts to write off signs of a Trump win.
Another: Response rates differed based on the events of the campaign, pollsters say. Trump supporters were more likely to respond to pollsters when things were going well for him than when he was struggling, and the same for Clinton backers, skewing the true picture.
And some people may have been reluctant to say they were supporting Trump. His campaign manager, pollster Kellyanne Conway, told reporters, "The undercover Trump vote was real." For instance, polling throughout the race showed a gender gap bedeviling the Republican. But in the exit polls, Trump won 60 percent of white men and 52 percent of white women.
Clinton was a flawed candidate. The Clinton campaign believed its carefully constructed statistical models - which tracked toward a win - and scoffed at doubting Democrats as "bed wetters." Clinton did not devote resources to Wisconsin or Michigan until the end, though those states, along with Pennsylvania, were part of the "blue wall" that was vital to her electoral strategy. Trump took all three states.
"Democrats had a flawed candidate who didn't have a clear message that came through," said Rebecca Kirszner-Katz, a party strategist based in New York. "They were not able to turn out as many of their voters as Obama did. Trump mobilized his base."