If the US presidential campaign conveys a flavour of unreality, that may be because it is rooted in fiction. In 1935, Sinclair Lewis sat down to write a novel about political radicalisation and social upheaval in the depression-ravaged US. What emerged after four months of feverish work was It Can’t Happen Here, a runaway bestseller that quickly sold more than 300,000 copies.

Lewis was alarmed by what was taking shape in the country. The New Deal had delivered a false sense of optimism to the Federal Reserve, if not to the millions queueing at the soup kitchens. The money supply was tightened in anticipation of a sustained rally, government spending was cut and taxes were raised. As a result, the US was pushed to the cusp of a double-dip depression, with manufacturing back to its 1934 level and unemployment up by 5%.

This created fertile ground for Father Charles Coughlin, Huey Long, William Randolph Hearst and other fanatics to spread the gospel of bigotry. It was no fleeting backlash: on the eve of the second world war, the German American Bund packed more than 20,000 militants into Madison Square Garden in New York for a pro-Hitler rally. To wild applause, their leader, Fritz Kuhn, derided the US President as Franklin D “Rosenfeld”.

Controversial Louisiana senator Huey Long, who was accused of being a demagogue, was assassinated in 1935. Photograph: Alamy

Lewis’s antihero is the ignorant demagogue Berzelius “Buzz” Windrip, who wins the 1936 election with the support of millions of impoverished and angry voters. They marched carrying placards that read: “We are on relief. We want to become human beings again. We want Buzz!”

Windrip could count on a number of real-life champions who appear in the novel, such as the newspaper tycoon William Randolph Hearst. In 1935, the man widely regarded as responsible for goading the US into the Spanish-American war proclaimed: “Whenever you hear a prominent American called a fascist, you can usually make up your mind that the man is simply a loyal citizen who stands up for Americanism.”

Lewis’s hero, the New England journalist Doremus Jessup, attends a Windrip rally in Madison Square Garden. Jessup reports that Windrip’s rhetoric was irresistible to his thousands of downtrodden admirers. He later can’t remember a word Windrip said. But it doesn’t matter: if Windrip contradicts himself, backtracks on policy or simply spews out a torrent of lies, he tells them what they want to hear. Every American will be guaranteed a minimum income of $5,000 ($88,000 in today’s money), US-hating Mexico will be severely dealt with and Jewish bankers will be punished for landing the country in this mess.

Windrip unveils his 15-point manifesto, which includes “prison or the death penalty” for anyone advocating communism and the recognition of Jews as “fully Americanised”, so long as they continue to support “our ideals”. Substitute “Muslim” for “communist” and “Hispanic” for “Jew” and there emerges an uncomfortable picture of what is taking place in the US today.

Windrip wins the election. He orders the invasion of Mexico, after which his victorious militia returns singing When Johnny Comes Marching Home. Political opponents are herded into concentration camps, while a flood of refugees flee across the border to Canada.

In the end, though, it is only a work of fiction – and millions of Americans cling to the belief that it will remain so. Fingers crossed on 8 November.

Jules Stewart is the author of Gotham Rising: New York in the 1930s, published in November by IB Tauris. To order a copy for £20, go to bookshop.theguardian.com or call 0330 333 6846. Free UK p&p over £10, online orders only. Phone orders min p&p of £1.99.