LEESBURG, Va. — They looked like two old guys on a park bench, Jimmy Carter and Walter Mondale, their canes resting nearby, sitting onstage talking about human rights before an audience of old friends.

Then Carter, 94, and Mondale, 91, started kicking butt.

The 39th president said he believes President Trump actually lost the 2016 election: “He was put into office because the Russians interfered on his behalf.” He also said Trump’s immigration policies “send a disgraceful signal around the world” that the United States stands for “torture and kidnapping of little children.”

Mondale, who was Carter’s vice president, blasted Trump for being a “cheerleader” for the “right-wing surge” of authoritarian leadership around the world. He said he was “hateful” in a way he’d never seen before. He suggested that Trump had “psychological problems” and said, “he’s got something deep in him that is detestable.”

As the rhetoric unexpectedly heated up, Carter Center supporters attending their annual retreat at the Lansdowne resort applauded with delight. Historian Jon Meacham, moderating the discussion, pressed Carter about his contention that a full investigation of the 2016 election would show that Trump “didn’t actually win.”

Meacham asked if Carter was saying Trump is “an illegitimate president.” Carter, who has generally — but not always — refrained from attacking Trump publicly, laughed and said, “Based on what I just said, which I can’t retract.”

After the event, Meacham called Carter’s comments “potentially historic.”

“Has a former president ever said that one of his successors was not a legitimate president?” he asked.

Carter’s statements were all the more remarkable because he has been less frosty to Trump than the other living ex-presidents — Bill Clinton, George W. Bush and Barack Obama.

Trump called Carter in April to discuss China and North Korea. Carter has offered to travel to North Korea to meet with Kim Jong Un to help with Trump’s efforts there. Carter also wrote to Trump about China, a letter the White House called “beautiful.”

The annual Carter Center weekend has been going on for 27 years. For the first time, the Carters opened part of the program — a discussion of human rights — to the media. And Carter and Mondale jumped right into the current political fray, with C-SPAN carrying the event live.

“Human rights is his core — it comes from his soul,” said Jay Beck, a consultant for the Carter Center who has known Carter since 1966 and worked in his White House.

Beck said Carter and Mondale, two military veterans who made a career in public service, are concerned about the country’s direction under Trump.

“Their frustration bubbled up from that,” he said.

Carter returned several times to Trump’s policies toward immigrants and asylum seekers. He said that “discrimination against newcomers to our country, just seeking relief from persecution,” is a “serious human rights mistake.”

“The United States doesn’t stand anymore for human rights” under Trump, Carter said. “We are opposed to some human rights, openly and without being embarrassed by it.”

Much of Carter and Mondale’s discussion focused on issues from the era when they were in power: Vietnamese boat people, the return of the Panama Canal to Panamanian control, apartheid policies in South Africa.

The audience, many of whom worked for the Carter administration four decades ago, reveled in the time travel. They enjoyed the Bingo, the visits to historic homes, and they eagerly bid in the annual auction, which raised almost $4 million for the Carter Center last year.

This year’s auction items included a rocking chair and cedar chest handcrafted by Carter, an electric guitar signed by all the members of the Rolling Stones, and Bass Force One, a fishing boat painted to look like Air Force One.

But it was current events that seemed to most energize the duo.

Carter said he, unlike Trump, would have demanded more investigation into the death of journalist Jamal Khashoggi, The Washington Post columnist killed in October by Saudi security agents in the Saudi consulate in Istanbul.

“I believe we would have demanded a complete accounting about how high up the orders came from,” Carter said, adding that he believed the assassination could only have been carried out with the approval of the top levels of government.

A recently concluded U.N. investigation into Khashoggi’s death faulted the United States and other countries for not exerting enough pressure on Saudi Arabia despite “credible evidence” that Saudi Crown Prince Mohammed bin Salman was involved in Khashoggi’s killing.

Carter spoke while Trump was at a Group of 20 summit in Japan, photographed smiling with bin Salman, Russian President Vladimir Putin and Turkish President Recep Tayyip Erdogan.

Asked about the rise of authoritarianism around the world, Carter said the U.S. commitment to human rights has been eroded since the Sept. 11, 2001, terrorist attacks. He said that included new restrictions on the privacy of American citizens and the torture of suspected terrorists.

He said the United States was no longer the leading “champion of human rights” in the world.

“The would-be human rights violators in foreign countries, that used to be restrained by America’s restraint, have had that restraint lifted and they become abusive more than they would have because the United States is no longer the example,” he said.

Carter was asked by an audience member what steps a new president could take to “restore the moral authority of the United States on human rights.”

He said he agreed with what many of the Democratic candidates have said: rescind Trump’s border policies, rejoin the Paris agreement on climate change and work with other countries on human rights.

“A lot of what Trump has done to damage our country’s reputation is by executive order,” he said. A new Democratic president could reverse those, he suggested.

Asked after the event what he meant by Trump being “detestable,” Mondale ticked off reasons: “his looseness in relation to facts, he seems to start personal fights all the time. He doesn’t give a sense of purpose, confidence and pride to those in public service.”

Mondale, the Democratic Party’s 1984 nominee for president who lost in a landslide to Ronald Reagan, joked that nobody was asking him for strategy about how to beat Trump.

But, he said, “Debates matter.”

He recalled how Reagan in 1984 hit him with one of the most memorable debate zingers of all time. Reagan, 73 at the time, was asked whether he was too old for the job. He replied: “I will not make age an issue of this campaign. I’m not going to exploit for political purposes my opponent’s youth and inexperience.”

Mondale said age may be a factor in the current presidential race: “They are talking about left and right, but maybe it’s young and old.”

At the end of the discussion, Secret Service agents led Carter and Mondale from the stage, and they joined Rosalynn Carter, 91, who had been sitting in the front row.

The three old friends, who were once among the most powerful people in the world, walked slowly toward the door, surrounded by fans wanting just a little more of their time.