Donald Trump is the second U.S. president in history to lose a reelection bid and then be elected again. Grover Cleveland was the first.

The Democrat, whose full name was Stephen Grover Cleveland, served as the nation’s 22nd president from 1885 to 1889 and was the first Democrat elected after the Civil War. He lost the White House to Republican Benjamin Harrison in 1888 – but won in 1892 and became the nation’s 24th president.

Many have drawn parallels between Trump and Cleveland, with Kevin Roberts, president of the Heritage Foundation, noting in a statement that Trump was “the first president since Grover Cleveland to win two nonconsecutive terms” and calling it “a historic and hard-fought victory.”

However, there were also notable differences between the two presidents and their campaigns.

While Cleveland won the popular vote in the 1888 election by more than 100,000 votes, Harrison won the electoral college vote 233 to 157. Like Trump, Cleveland also lost his reelection bid amid allegations of voter fraud, though unlike in the 2020 election, clear evidence of fraud was found in some states, including Indiana, The Washington Post previously reported.

And while Trump refused to concede his 2020 election loss to Joe Biden, Cleveland conceded gracefully to Harrison – even holding an umbrella over the new president as he delivered his inauguration remarks in the rain.

Cleveland, who was born in New Jersey in 1837 and raised in Upstate New York, worked as a lawyer in Buffalo before being elected mayor of Buffalo and later governor of New York.

As a politician, he was no stranger to scandal. He won his first term as president at age 47, as a bachelor – despite accusations that he had fathered a child out of wedlock – with an editorial cartoon circulating showing a baby screaming, “Ma, ma, where’s my pa?!”

Cleveland became famous for how he handled the crisis – telling political allies who asked him what they should do: “Whatever you do, tell the truth.” Cleveland admitted he had had an affair with the child’s mother and agreed to provide financial support, without being certain the child was his. Ultimately, the scandal did not stop Cleveland from winning the White House – and his famous quote on telling the truth gave him a reputation of being trustworthy.

In his first term, he made political enemies by vetoing more than 400 bills sent to him by the Republican Congress. Once, when warned his stance on lower tariffs on imports would hurt him politically, he famously retorted: “What is the use of being elected or reelected unless you stand for something?”

He was considered by many a lifelong bachelor, until he married a woman 27 years his junior in 1886, becoming the first president to be married in a White House ceremony. His wife, Frances Cleveland, became the youngest American first lady in history at age 21 and was extremely popular, according to historians.

When Cleveland lost his 1888 reelection campaign, Frances told White House staff: “We are coming back four years from today” – a quote mirrored by Trump’s comments more than 100 years later, at a White House Christmas party, where he said: “We’re trying to do another four years. Otherwise, I’ll see you in four years.”

In his years away from office, Cleveland worked in a prestigious law firm – but by the time of the 1892 Democratic National Convention, he was the party’s first choice for nominee. “Grover’s Name Towers Over All,” the Pittsburgh Dispatch wrote. This time the election, a Cleveland-Harrison rerun, was won easily by Cleveland.

During his second-term, he was faced with an economic depression, during which his policies were broadly unpopular. Cleveland’s party eventually deserted him, nominating William Jennings Bryan in 1896.

Only a handful of former presidents have attempted to win back the White House years after leaving office. The others are Martin Van Buren, Millard Fillmore, Ulysses S. Grant, Theodore Roosevelt and Herbert Hoover.

Cleveland – and now Trump – are the only two presidents to achieve it.

Cleveland died in 1908. His last words, according to historians, were “I have tried so hard to do right.”