In a stunning upset that proved the polls, the pundits, and the data wrong, Donald Trump has been elected the 45th president of the United States of America. The Republican candidate's election represents a massive failure of the soothsaying machine, which predicted that the better funded, deeply connected, infinitely more experienced Hillary Clinton would become the first woman US president. Instead, the country has elected a man with no political experience nor concrete plans for making good on the sweeping promises he made to his wildly enthusiastic core constituents.

Over the past year, the American people faced a stark choice between an optimistic future and an idealized past. On one side stood a candidate who argued that the American dream is dead, laid to rest by forces like immigration and trade, and the only way forward is to go back. On the other was a candidate who argued that the country didn't need to be made "great again," but could be made greater still by adapting to inevitable changes. Clinton held up immigration as proof that the American Dream remains very much alive, as strivers around the world vie to participate in the world’s largest economy, home to the world’s most successful businesses.

Tonight, American voters clearly said they didn't buy it.

Trump won the race with 56,897,955 popular votes and 276 electoral votes, compared with 55,877,015 popular votes and 218 electoral votes for Clinton, according to the AP.

The returns looked good for Trump from the start. The decisive break for Trump came in Wisconsin, long considered part of Clinton's electoral "firewall." And it didn't stop there. Trump won Pennsylvania and its 20 electoral votes. Clinton underperformed even in states she won, like Nevada and Virginia, eking out margins far lower than Obama secured in 2012. Clinton's vaunted ground game was not enough to keep Trump from carrying Florida with a narrow 1.4 percent margin of victory. He swept all key battleground states, including Ohio and North Carolina, to take the White House. As Trump carried the south, the midwest, and rural areas nationwide, it became clear that the country is far more divided on fundamental issues than many people believed.

At a small gathering at the Hilton Hotel in midtown New York City, the Trump team was uproarious. Even die-hard supporters didn't see so definitive a win coming. People screamed with delight as results came in and the networks called states for Trump. James Davis, a black pastor from Akron, Ohio, had to speak up over the din of the crowd to explain why he's always been for Trump. "I just believe Trump has the skill and the business acumen to bring that skill set to the White House, and we'd have a better economy for people who look like me," he said. Around him, a sea of red-hatted supporters chanted, "Can't stop the Trump."

If Trump's supporters didn't see it coming, certainly the world didn't either. As the likelihood of a Trump victory grew over the course of the evening, Asian markets plunged, as did the Mexican peso and US stock futures, which were down as much as 800 points.

On Monday, Clinton looked to have the race wrapped up. Tightening polls began to loosen, predicting a popular vote win for her with a margin of 3 to 6 percent. Famed election forecaster Nate Silver, who called every state correctly in the 2012 race, gave Clinton a better than two in three chance of winning. Other forecasts put her chances higher still. As at every other turn in this seemingly endless campaign, Trump defied the conventional political wisdom.

Over 18 long months, during which Trump used social media and free TV air time to plow through 16 deeply experienced, well-funded Republican primary candidates, it seemed no scandal could stick to him. The conventional wisdom about how to run a campaign was cast aside. Clinton raised far more money and vastly outspent Trump, who relied on energetic rallies of faithful supporters to fuel his rise. While Clinton had the backing of several presidents—including President Obama and, of course, her husband Bill—Trump relied on a motley crew of surrogates from the fringes of the Republican party as mainstream GOPers shunned his campaign. And still, he ascended.

Before long, #LOLNothingMatters had become the new mantra.

Open your campaign by calling all Mexicans rapists, as Trump did, and insult pretty much every other racial group in the US except White people over many long months? Didn't matter. After the Washington Post released audio from a 2005 taping of Access Hollywood in which Trump bragged about grabbing women by the vaginas and several women came forward to say the president-elect sexually assaulted them in incidents dating to the 1970s, many mainstream Republicans rescinded their endorsements of Trump. It began to seem like finally one of Trump's scandals would capture the nation's attention. House Speaker Paul Ryan said he would no longer defend Trump or campaign with him, an extraordinary repudiation of a major party candidate by its top elected official. More than a dozen women ultimately accused Trump of grabbing, groping, or kissing them without consent. Trump denied the allegations and threatened to sue his accusers.

Ryan's decision to sort-of-not-endorse-but-also-sort-of-endorse led to one of Trump's countless Twitter tantrums. His emissions of 140-character outrage were a regular feature of the campaign. Targets included former Miss Universe Alicia Machado, whom Trump had derided for gaining weight in the 1990s, a fact Clinton noted during the first presidential debate. Trump took the bait, as he often did during a campaign which seldom showed discipline or a thought-out strategy. But in the end, none of that hurt him. None of it mattered. And more than that, everything the pundits thought did matter turned out not to be enough. Ground game wasn't enough. Nuanced policy platforms were not enough. Debate performance wasn't enough. That Trump had none of the things Americans normally require of their candidates didn't matter.

During the last 10 days of the campaign, Trump remained relatively quiet. That uncharacteristic restraint emerged following the release of FBI Director James Comey's letter to members of Congress revealing that the agency was investigating newly discovered emails possibly pertinent to its investigation of the private email server Clinton maintained as Secretary of State. Though polls had already shown a tightening race, the revelations went to the heart of voter distrust. Though Comey told Congress that his team had found nothing in those emails a week later, it didn't matter. The damage was done. And in managing to finally keep the cameras off himself, Trump was able to eke out his unlikely victory.

Now that the race is over and Trump is victorious all the attention is on him. A lawsuit in federal court accuses Trump of fraud over his defunct Trump University. (Trump notoriously questioned the ability of the judge in the case to remain unbiased because of his Mexican heritage.) Trump's many dubious financial dealings are also likely to receive much greater scrutiny. The New York Attorney General's Office is investigating the Trump Foundation after groundbreaking reporting by the Washington Post's David Fahrenthold found virtually no charitable giving and much potential self-dealing. Trump's many foreign business entanglements, particularly any potential ties to Russia, will be under scrutiny. So will Trump's personal finances: In an unprecedented break from tradition, Trump took the White House without releasing his tax returns.

Few people bring this much baggage to the White House. Trump was enthusiastically embraced by openly racist groups like the Ku Klux Klan and white nationalists like David Duke, who has claimed Trump's victory as his own. If Americans thought the presidential campaign was ugly, they're likely in for more of the same. Trump will likely also enjoy a Republican majority in both houses of Congress, though barely. If just a few moderate Republicans alienated by Trump ally themselves with Democrats, they could thwart most of Trump's legislative agenda, if such a thing exists. Trump is the most volatile presidential candidate in recent memory, and now he will be president. What that means for the presidency, the federal government, and the country itself is as unpredictable as he is.

Update (November 9, 2016, 6:40PM ET): Removes reference to civil suit in which plaintiff alleged Trump raped her when she was 13. The accuser dropped the lawsuit Friday.