Donald Trump's Tuesday night stunner eerily mimicked the topsy-turvy finale of the 1948 presidential election: Both were won by an underdog — who was written off by his party, the pollsters and political mavens, but who was supremely confident of his supporters' loyalties. Then as now, clues to what was afoot were there to be found, had a dogged reporter been looking for them.

In 1948, the media downplayed the crowds that attended President Harry Truman's whistle-stop tour. The smart money was on New York Gov. Thomas Dewey, his Republican challenger. Speaking from the rear platform of a railroad car seemed a quaintly old-fashioned and inefficient way to campaign, as the Tribune noted when the president's 17-car train made three stops in California one day in September:

"Experienced observers sensed a disappointment in the large crowd that had gone all-out to welcome the president. In these observers' opinion the president was the victim of amateurish advice from his political advisers in tossing off a bob-tailed talk that fell short of meeting the occasion."

What those observers missed was the electricity that passed between Truman and his audience via a call-and-response mantra.

During a stop in Harrisburg, Ill., Truman was lambasting the Republicans when a supporter called out: "Give 'em hell, Harry!" To which the president replied: "I don't give them hell. I just tell the truth about them and they think it's hell."

When election returns started rolling in, the Tribune wrote its famous missed-by-a-mile headline over an early edition: "Dewey defeats Truman."

Chicago Tribune

The famous front page of the Chicago Daily Tribune, which erroneously declared that Republican Thomas Dewey had defeated incumbent President Harry Truman in the 1948 presidential election.

The famous front page of the Chicago Daily Tribune, which erroneously declared that Republican Thomas Dewey had defeated incumbent President Harry Truman in the 1948 presidential election.

(Chicago Tribune)

But the Tribune wasn't alone in having egg on its face. The Washington Post put a sign on its building: "Mr. President, we are ready to eat crow whenever you want to serve it." At a White House bash celebrating his victory, Truman debuted a drop-dead impression of H.V. Kaltenborn, who had forecast Dewey's victory, imitating the noted broadcaster's staccato delivery: "The pres-i-dent is still ahead ... but we have yet to hear from Cal-i-for-nia ..."

It wasn't just conservative publications that took a dim view of Truman's chances. Like Trump, he took guff from both sides of the aisle. Early in 1948, the New Republic, a venerable liberal magazine, published a front-page editorial, titled: "As A Candidate For President, Harry Truman Should Quit."

By September, Democratic officeholders and candidates were distancing themselves from Truman, just as some Republicans ditched Trump this year. In a dispatch from Jackson, Tenn., the Tribune reported: "Democrats here are beginning to feel President Truman's dead weight on the ticket. Estes Kefauver, Democratic nominee for senator, in the opening speech of his campaign Saturday deliberately threw Truman to the wolves, in the hopes of increasing his own chances."

Kefauver, who was leery of Truman because of the president's support for civil rights, announced he would vote for Truman "as the lesser of two evils." Other Southern Democrats went a step further. Bolting the party, they supported Sen. Strom Thurmond of South Carolina, the presidential nominee of a newly formed, pro-segregation, States' Rights Democratic Party, commonly known as the Dixiecrats.

The Democrats were a hydra-headed party. An unholy alliance of Northern civil rights advocates and Dixiecrats, liberals and conservatives, it had been held together by the personal magnetism of President Franklin Roosevelt, Truman's predecessor. But in 1948, the first election since FDR's death brought Truman to the presidency, the Southerner wing was not the only faction to desert him. Liberals and leftists who feared Truman wouldn't continue the social reforms of FDR's New Deal pulled away too. They formed a Progressive Party and nominated the quixotic Henry Wallace, another former Democratic vice president. A peacenik in a Cold War political environment, Wallace didn't get a single electoral vote, but Thurmond won 39.

Not only did Truman have to battle on three fronts — against the Republicans and the two split-off Democratic factions — but he also was confronted by an inertial force built into American politics. FDR had been elected four times, including the term that Truman finished — an extraordinarily long time for one party to hold on to the White House. During those years, America had experienced the Great Depression and World War II. It seemed that the voters were ready for a change in 1948.

In an election two years earlier, the Republicans had won control of the Senate and House of Representatives. By 1948, public opinion polling, then in its infancy, showed a White House in the Republicans' future. An Elmo Roper poll taken just after Labor Day found that respondents preferred Dewey over Truman, by 44.3 percent to 31.4 percent.

When Truman completed his 31,000-mile campaign tour on Oct. 31, the Tribune reported him "cheerfully confident of victory," but that his "surface optimism contrasted with the jittery and fearful attitude of his entourage." On the eve of the election, under a headline "Landslide Predicted For Dewey-Warren," the Tribune confidently expected the Republican running mates to win 400 electoral votes.

But when the ballots were counted, Dewey had 189 and Truman 303 electoral votes. Truman won the popular vote, too, with 24.1 million votes to Dewey's 22 million. Standing on the courthouse steps in his hometown of Independence, Mo., Truman told a crowd of 30,000: "It was not my victory but a victory for the Democratic Party, for the people."

The subsequent search for the cause of the upset was accompanied by intramural backbiting. A Republican congressman, who won his race for re-election, said: "The trouble with Dewey was that he did not give the American people a clear-cut issue." On the other hand, some of Dewey's aides complained to the press that they couldn't get a hearing for their advice to come out slugging. "But they were overcome by a majority of the 'Dewey team,' including the defeated Republican candidate himself, who favored a 'high-level' campaign. based on a 'unite America' theme."

Analysis of the vote showed that the farm vote played a crucial role in Truman's victory, which Leslie Biffle said he already knew. A Democratic Party official, Biffle claimed to have predicted Truman's victory with his own "barn yard poll." With experts saying that Dewey was sure to win, Biffle traveled across the nation in an old truck, pretending to be a chicken buyer. He just couldn't believe that his old friend President Truman was as unpopular as the professional pollsters claimed.

"I went out to see what the people were thinking, and I found out," Biffle said of his methodology.

But perhaps the most evocative postmortem was the Tribune's. It acknowledged the error of its coverage with an analogy that could be applied also to this year's election.

"Our hearts were not bound up in Dewey's cause," the editors wrote. "We shared the sentiments of the lady from Atlanta who said, a few weeks before the election, 'Thank God, they both can't be elected.' "