Image caption Just how much does Donald Trump's presidency resemble Millard Fillmore's?

Millard Fillmore is one of the most obscure US presidents, but there is plenty about him that may seem uncannily familiar.

Asylum seekers and economic migrants are flocking to the United States.

Nativism spreads like a prairie fire, fuelled by warnings that these foreigners will drive up crime, drive down wages and destroy the nation.

An anti-immigrant president from New York rises to power. He has a proclivity for conspiracy theories and appoints his daughter to a key White House role.

But the year isn't 2016.

It's 1850.

It's not Donald Trump.

It's Millard Fillmore, whose sheer anonymity has made him an in-joke among presidential history fans.

Instead of Muslim or Central American refugees, it's Germans and Irish Catholics.

Mr Trump prefers to liken himself to Andrew Jackson, the seventh US president.

And there are similarities between the two.

Image copyright Getty Images Image caption Fillmore launched his career on the back of a conspiracy theory

Both were populist outsiders who were dismissed as unfit to govern by an out-of-touch Washington elite.

However, Jackson was a Democrat and a war hero who defeated the British at the Battle of New Orleans.

It's difficult to imagine Old Hickory, as he was known, excusing himself from military duty on the grounds that he could not march long distances, as Mr Trump did during the Vietnam War, citing bone spurs.

The parallels between the 45th president and the 13th - unlucky for some - are arguably more compelling.

Fillmore launched his career in the 1820s with the Anti-Masonic Party, hawking a paranoid rumour that ruling Freemasons were murdering whistleblowers.

Mr Trump paved the way for his White House bid by peddling a conspiracy theory, too - that President Barack Obama was not a US citizen.

Image copyright Getty Images Image caption Millard was initially vice-president to Zachary Taylor (L)

Fillmore later joined the Whig Party at a time of mounting hostility to refugees from famine, rebellion and tyranny who were arriving by the shipload at the gates of the New World.

Democrats embraced these predominantly Catholic huddled masses as a new voting bloc.

But as his biographer Robert Rayback writes, Fillmore shared the fear of some other top Whigs that the incoming papist hordes would plot to subvert America's sovereignty.

When Millard lost his race for New York governor in 1844, he blamed "foreign Catholics".

Immigrant voters were "corrupting the ballot box - that great palladium of our liberty - into an unmeaning mockery", he fumed.

Compare this with Mr Trump's unfounded claim that millions of illegal immigrants cast votes in the last White House election.

There's also a familiar ring to Fillmore's gripe about American jobs being taken by "men of foreign birth to the exclusion of the native born".

Millard became vice-president to Zachary Taylor in 1849 and, following Old Rough and Ready's untimely demise a year later, an accidental president.

Fillmore biographer Paul Finkelman, who is president of Gratz College in Greater Philadelphia, says: "When Fillmore comes into office, the first thing he does is to literally fire his whole cabinet.

"Donald Trump has had more cabinet turnover than any other president probably since Millard Fillmore.

"The Fillmore administration was in constant turmoil because you didn't know who was running things from one day to the next, and that's precisely the same situation with Trump. It's government by chaos."

Millard's daughter, Abby, became White House hostess, a position as high-profile as Ivanka Trump's. First Lady Abigail Fillmore was an introvert who largely shunned social functions - not dissimilar to Melania Trump.

Image copyright Getty Images Image caption Abigail Powers Fillmore and Melania Trump

This president's undoing was his support for the Compromise of 1850, a pact between slave states and free states that was a signpost to the US Civil War. His stance on the toxic debate angered African-Americans.

Dr Finkelman's biography notes that one Ohio preacher said: "Would not the devil do well to rent out hell and move to the United States and rival if possible, President Fillmore and his political followers?"

Many black leaders and their allies today sound no less scathing of Mr Trump.

In a humiliating snub, Fillmore was denied his party's nomination in 1852. He quit the Whigs to lead the virulently anti-immigrant, anti-Catholic American Party.

Dubbed the Know Nothings, they openly fomented ethnic and racial bigotry, culminating in 1855 with Bloody Monday, when Protestant mobs attacked German and Irish neighbourhoods in Louisville, Kentucky, leaving at least 22 people dead.

At the elections a year later, the American Party carried just one state: Maryland - ironic, considering it had been founded as a sanctuary colony for English Catholics.

Politically, Fillmore was no more.

More on US presidents

The Whigs never recovered from his presidency. And out of their ashes rose the Republican Party led by Abraham Lincoln.

Joan Cashin, professor of history at Ohio State University, points out there are differences between Trump and Fillmore, not least that the latter grew up in rural poverty and was regarded as a polite, bland politician.

Trump was the playboy son of a real estate millionaire - Fillmore was an indentured child apprentice in a textile mill.

Image copyright Getty Images Image caption The early home of Fillmore in New Hope, Cayuga County, New York

Image copyright Getty Images Image caption Trump's childhood home in Queens, New York City

But Prof Cashin draws a distinct link between mid-19th Century prejudices and today.

"The notion that native-born white Anglo-Saxon Protestants are supposed to be in charge," she says, "that they decide who's allowed to come here, that's a parallel.

"Except for Native Americans, we're all immigrants to one degree or another in this country.

"I think it was Martin Luther King who said, 'we may have come here in different ships, but we're all in the same boat now.'"

A postscript: Millard was held to be strikingly good looking. Queen Victoria reputedly praised him as the handsomest man she had ever met.

Some people see an uncanny resemblance between Fillmore and the actor Alec Baldwin.

Baldwin, of course, plays Mr Trump on the comedy show Saturday Night Live.

The 13th president has faded in popular memory to little more than a trivia question. His Know Nothings are a warning from the past. And it is decades since the Millard Fillmore Society was last heard of.

According to research, barely 8% of US college students are even aware who he was.

If Mr Trump finds himself on the wrong side of history, he could one day be cruelly forgotten, too.

Given America's enduring disunity, a prayer once uttered by Fillmore still seems to resonate: "May God save the country, for it is evident that the people will not."