Last month, Gallup released a poll showing that 56 percent of Americans believed that Donald Trump would win re-election. In retrospect, it may have been inevitable that they would be proven wrong.

The messages Trump planned to run on — a great economy and an untrustworthy opponent — didn't work. The economy was sent into a tailspin by the coronavirus pandemic and has only partially recovered. No one blames Trump for the pandemic, but plenty have complaints about how he’s handled it.

Trump continues to contest the results, but he suffered a clear popular vote loss and it appears that Democrat Joe Biden will carry the exact same number of electoral votes -- 306 -- that Trump picked up during his 2016 victory, which also turned on narrow margins in a small number of states.

Trump is the first incumbent president to lose since George H.W. Bush in 1992. In the days leading up to Nov. 3, coronavirus numbers spiked, with deaths increasing and new cases coming close to 100,000 new cases a day (a threshold easily topped in the days since). Those circumstances would have made it difficult for any incumbent to win.

The good news -- unemployment dropping below 7 percent on Friday and Pfizer's Monday announcement of a promising coronavirus vaccine -- came just too late to help the president.

His fate may have been sealed as early as Nov. 9, 2016, when the country woke up to the prospect of a Trump presidency. Up until Election Day four years ago, few thought it would even be possible. That day, Trump himself warned his wife that they were going to have a bad night.

Once in office, Trump had no honeymoon. He’s the only president of the polling era never to win approval from the majority of the country. Instead, many Americans became radicalized, protesting by the millions starting the day after his inauguration and joining the self-styled resistance.

Democrats began rebuilding, taking control of the U.S. House and winning nine governorships in states Trump carried four years ago. They also regained ground at the legislative level following the GOP's dominance since 2010.

Democrats were unable to improve their positions last Tuesday. Democrats lost seats in the House, failed to win any legislative chambers and suffered a net loss of one governorship (Montana). Republicans appear on track to hold the U.S. Senate, but must wait on Jan. 5 runoffs to decide the two seats in Georgia.

Trump ran behind Republican House candidates nationwide. He was able to turn out the party's vote, but some small percentage of people voted against him before supporting Republicans further down the ballot, attesting to his personal vulnerabilities.

The polls may have overstated Biden's lead, but the shape of the presidential race was clear long before the coronavirus emerged. Biden's final lead, though inflated, had essentially been unchanged since the summer of 2019.

There will be any number of explanations for Trump’s loss in the days and weeks to come, but some factors are clear already:

1. Trump has limits as a politician

Trump, a true political outsider, won election to the presidency in his first run for office. He has reshaped one of the country’s major political parties, initially quite skeptical about him, after his own image.

But while Trump has been a masterful intraparty politician — winning nearly universal support among Republicans — he has not been strong at interparty politics. He made essentially no effort to win over voters beyond his base. That turned out not to be a wise move for a politician a majority of the country consistently disliked.

Trump has so completely dominated national life that it’s easy to forget he barely won four years ago. In 2016, running against an unpopular avatar of the incumbent party, Trump managed to tap into feelings of resentment and a desire to shake things up. He helped stave off the Democrats' long-touted demographic advantages by bringing out more white voters, particularly men.

Going into this year's election, population changes meant that Trump would lose if all groups voted the same way they did in 2016. This year, his sometimes overtly racist statements and policies helped drive away independents and college-educated voters, particularly suburban women. Although Trump made inroads among minority voters, notably Black and Hispanic men, the difference between 2016 and 2020 might be mainly that the share of the white vote declined from 71 percent to 65 percent, according to exit polling.

2. He mishandled his greatest test

Despite the constant drama of the Trump presidency, for the most part he enjoyed tremendous luck. With localized exceptions such as Hurricane Maria, Trump didn’t face any crises that weren’t of his own making, until this year.

Then the coronavirus struck. Trump routinely dismissed or politicized advice from his own health agencies. Without rehashing all the mistakes along the way, it was clear that the administration lacked a consistent strategy it could communicate clearly to the public.

Trump told Bob Woodward early on that he preferred to “play down” the virus. That was his instinct until the end, even after he’d contracted COVID-19 himself. He told voters the country was “turning the corner” on the disease. That was true only in the sense that things were getting much worse.

3. He squandered his advantage on the economy

Trump’s tax cuts and deregulatory approach helped drive up the stock market through the first three years of his term, while the country enjoyed historically low unemployment. All year, the economy was the one issue on which more voters favored Trump than Biden.

But Trump didn’t use the tools close at hand when the country suddenly fell into recession. The various emergency relief bills Congress passed in March succeeded in keeping some businesses afloat and increasing household income. There’s been nothing since then.

Even when the economy is strong, it’s a time-honored tactic for politicians to prime the pump ahead of an election. In this case, every economist from Federal Reserve Chair Jerome Powell on down was pleading for further fiscal stimulus but an at times indifferent Trump didn't prod Senate Republicans to deliver.

Given the close result in the end, imagine how things might have turned out differently if there'd been a second round of $1,200 checks, accompanied again by letters saying they came courtesy of Donald Trump.

4. Trump lacked a fresh message

During his first run for office, Trump offered bold proposals — build the wall, ban Muslims from entering the country, better trade deals. He made clear to opponents of abortion rights and gun control that he’d be a great champion, largely through judicial appointments. He also signaled to wavering voters that he was a moderate on some issues, pledging support for Social Security and other entitlements and saying he’d champion LGBTQ rights.

Trump made good on many if not all of those pledges, but he offered nothing new this year. The GOP crafted no platform and Trump repeatedly punted when asked what he wanted to do during a second term. He was left arguing that he was the one who could clean up the mess that had already occurred on his watch.

“Make America Great Again” was a powerful slogan. “Keep America Great” was less resonant at a time when most of the country remained nervous about health and the economy.

5. Biden was a tough opponent

Trump’s game plan all along was clear: Distract from his own unpopularity by demonizing his opponent. Calling Democrats “radical socialists” has become second nature to many Republicans, but the label didn’t stick on Biden.

Trump was left arguing that Biden would be the captive of radical socialists. That "Trojan horse" argument didn’t work. Characterizing Biden as doddering or even senile served mainly to anger seniors, who backed Trump in 2016 but whose support softened due to the pandemic.

Trump’s other attacks felt like a sequel lacking the freshness of the original. Dubious emails and charges of corruption resonated against Hillary Clinton, who had been pummeled politically for a quarter century before Trump came along. Biden, by contrast, was usually among the poorest senators during his long tenure in that chamber. The allegations that Biden’s son Hunter had profited from political connections had a glass houses quality, since Trump’s own children have clearly benefited from his residency in the White House.

Trump himself recognized that Biden would be tough. That’s why he pressured Ukraine’s president to dig up dirt on him. (It says something about 2020 and this presidency that impeachment — the vote acquitting Trump was on Feb. 5, just nine months ago — is a dim memory.)

Biden was not the dream candidate even of most Democrats, as his near-moribund campaign at the start of the primary voting season showed. But he turned out to have qualities that were helpful against Trump. Biden made empathy into a brand. The fact that he was already a well-known figure made people comfortable with the idea of him as president-in-waiting during the weeks when he was, in fact, stuck in his basement. That may not have been true to the same degree if the coronavirus had knocked Bernie Sanders or Elizabeth Warren off the campaign trail.

In 2016, the conventional wisdom was that any Democrat but Clinton could have beaten Trump. This year, Democrats may have nominated the one candidate with the right persona and positions to defeat Trump.