NEW YORK (AP) — It was an ugly, highly personal presidential election.

On the one side was an unvarnished celebrity outsider who pledged to represent the forgotten laborer. On the other was an intellectual member of the Washington establishment who was looking to extend a political dynasty in the White House.

The year was 1828.

Andrew Jackson’s triumph over President John Quincy Adams bore striking similarities to Donald Trump’s victory over Hillary Clinton last year. Some of those most eager to point that out are inside the Trump White House.

Both Jackson and Trump ran to represent the common man and both tried to expand executive power.

Historians agree there are parallels between Trump and Jackson, a war hero from Tennessee. But Trump, like Jackson before him, may prove to be a complicated figure.