Jimmy Carter won the presidency in 1976 because he understood the mood of the country, and because his message of populist reform reached disaffected voters in a way that eluded other more established politicians vying for the nomination in the aftermath of the Watergate scandal.

His signature lines, “I’ll never tell a lie,” and I’ll lead, “a government as good as its people,” as well as his promise to curb the excesses of the CIA, which had come to light around the time of Watergate, outshone and outmaneuvered a field of 17 candidates that included former Vice President Hubert Humphrey, Senators Morris “Mo” Udall, Birch Bayh, Fred Harris and Henry “Scoop” Jackson, and a charismatic new governor in California named Jerry Brown. He went on to beat incumbent GOP President Gerald Ford, but barely—he’d had a 30-point lead in the summer of 1976, and by Election Day, he lost all but one half of one point of it.

Carter’s political arc from insurgent outsider to humiliating loss, and now revered former president, is newly relevant to Democrats seeking to win the presidency in a morally fraught time. He won because he was different, a Southern Democrat who wasn’t a racist, and he spoke to voters’ hopes and fears through the lens of populism. He ran against Washington, and then Washington ran against him. His presidency is a cautionary tale in what happens if Democrats are divided.

Carter was a New South governor, declaring in his 1971 inaugural address in Georgia, “The time for racial discrimination is over.” He had a portrait of Dr. Martin Luther King, Jr installed in Georgia’s State Capitol. His party took notice, and Democratic National Committee Chairman Bob Strauss named him chairman of the DNC’s congressional and gubernatorial campaigns, “a huge boon” to Carter’s national ambitions, says Les Francis, who first met Carter when he was a young aide working for California Rep. Norm Mineta, one of the leaders of the Democratic class of ’74, elected after Watergate. Carter invited him to come hear his pitch at a $25 a head fundraiser at a nearby Sheraton hotel. “We had been briefed by (Democratic pollsters) Pat Caddell and Peter Hart on polling post-Nixon that showed voters wanted honesty, integrity and confidence in government restored. I realized Carter was hitting all those notes. Maybe he was at 1 percent now, but he was on to something,” Francis said.

Carter was a longshot, and the press mocked him for his Pollyanna promise about never telling a lie. But the voters listened. His slogan: “Send a president, not a message.” He ran as a conservative Democrat, carrying every Southern state except Virginia. He defeated segregationist Alabama Governor George Wallace in the 1976 Florida and North Carolina Democratic primaries, ridding the party of Wallace’s racist scourge. Carter won Iowa and New Hampshire, because more liberal candidates split the liberal vote. Even so, the dust didn’t really settle until May, but when it did, Carter had the nomination.

In the general election, he ran as a populist against a tax code that rewarded the rich and a government that had failed the people. “We were not pledging a new Great Society, we were running against Watergate,” says Stu Eizenstat, Carter’s top policy adviser, who recalled in an interview with The Daily Beast how Carter came into the Democratic Convention in New York in July 1976 with a 30-point lead over President Gerald Ford “and lost all but one half of one percent” by Election Day in November.

Eizenstat says Carter lost his luster as an insurgent outsider when labor leaders, big-city mayors, and even some feminist groups endorsed him. As he worked to get the various elements in the Democratic Party behind him, moderates saw him as just another traditional Democrat, and he steadily lost ground in the polls. He would say, according to Eizenstat, “The Democratic Party became an albatross around my neck.”

The fault lines in his candidacy became apparent in the fall campaign, and if Ford had not pardoned Nixon, he almost certainly would have carried the election. Carter won with such a narrow margin that when a New York Times reporter asked what legislative initiatives Carter would undertake, Eizenstat said that lacking a mandate, they would have to adjust their vision and start small.

Carter reamed him out for that. He thought big about the energy crisis facing the country, and the potential for peace in the Middle East. And right out of the box, he picked a fight with the Democratic Congress over funding water projects, threatening to veto a public works bill if it contained any projects on his “hit list.” Carter was always progressive on the environment and civil rights, but he was a fiscal conservative. He couldn’t abide what he saw as wasteful and unnecessary government spending.

He failed to realize the importance of these projects to individual lawmakers. He backed off his veto threat under pressure from Democratic Speaker Tip O’Neill, but a sour tone had been set. And Carter looked weak to boot, having bowed to pressure. The next year, 1978, he won two big veto fights over spending, one on public works and water projects, the other on defense spending over an additional nuclear carrier he didn’t think was necessary.

He won both fights with the help of Republican votes in the Democratic-controlled Congress. Democratic Majority Leader Jim Wright said Carter’s tactics made Lyndon Johnson look like a Sunday School teacher. “We took that as a compliment,” Francis recalls.

Resentment built on Capitol Hill among Democrats about the interloper who wasn’t one of them, and when Carter resisted Senator Ted Kennedy’s demands for universal health care, essentially the Medicare for all that some Democrats propose today, the result was an open break within the party.

Carter proposed a piecemeal approach, arguing for budget constraints, which Kennedy rejected, deciding instead to challenge Carter in the primaries. “It was a cover, an excuse for Kennedy and the Kennedy forces to get into the race,” says Francis, adding, “I understood that nostalgia for restoring Camelot. Jack Kennedy was my inspiration, Bobby was my hero.”

Eizenstat details in his book, Jimmy Carter: The White House Years, the many liberal initiatives Carter supported that weren’t enough to hold off Kennedy. Though Carter had twice as many delegates when the Democratic Convention convened in Madison Square Garden in the summer of 1980, it was not a happy time.

“I’d never seen such anger since 1968,” says Eizenstat. “Kennedy wanted government-run Medicare, so Kennedy, instead of being a gracious loser, had to be pushed onstage. And instead of a unity speech, he says, ‘The dream will never die,’ and he doesn’t campaign for Carter, and we end up with Reagan.

“That split was just fatal. Maybe we would have lost anyway, but we would have won more than six states and the District of Columbia.”

While the Democrats fought over whether Carter’s proposed health care reform was expansive enough, Republican nominee Ronald Reagan took away Carter’s white conservative base and captured white evangelicals. Jerry Falwell, who launched the Moral Majority in 1979, said Carter was “not a real Baptist.” The silent majority of disaffected whites initially identified by President Nixon and then coalesced by Reagan is President Trump’s coalition to this day.

Reagan took advantage of an economy with high interest rates and gas shortages, plus he had a united party while Carter was facing a challenge from the left that would prove crippling.

Carter had won the South back from Nixon and the Republicans in 1976. Then he lost it, along with much of the country. The Democratic Party treated Carter like a pariah. In 1984, he wasn’t given a primetime speaking slot at the convention, and some people didn’t want him there at all. By 1988, he had built the Carter Center and was responding to needs around the world as he saw them, rebuilding his own image in the process. The Democratic Convention was in Atlanta that year, and Carter used the proximity to re-enter the political world on better terms.

Today, almost 40 years after he left Washington as a failed president, Carter is now hailed as one of his party’s most liberal voices. He voted for Bernie Sanders in the 2016 Georgia primary, although that might have had more to do with his animus against the Clintons. His chief of staff, the late Hamilton Jordan, referred to them as the “First Grifters.”

Senators Amy Klobuchar and Cory Booker have made the trek to Georgia to seek Carter’s counsel, and Mayor Pete Buttigieg is scheduled to attend Carter’s Sunday School lesson at the Marantha Baptist Church in Plains on May 5.

President Trump called Carter last month to follow up on a letter he had sent him with advice about negotiating with China. Carter told his Sunday School class that Trump is concerned about China “getting ahead of us.” He said he agreed with Trump, pointing out that since 1979, when as president he normalized relations with China, “We have wasted, I think, $3 trillion. China has not wasted a single penny on war, and that’s why they’re ahead of us in almost every way.”

He called the United States “the most warlike nation in the history of the world,” the kind of statement that aligns Carter with the progressive left. “He is seen as more liberal now than he was in ’76 and when he was in the White House in the context of national security, foreign policy and national defense where he is more open about his beliefs, skeptical about the use of force, and has a very distinct point of view about the Middle East and the relationship with the Israelis and Palestinians, which put him to the left of the foreign policy establishment. That’s the key,” Les Francis told The Daily Beast.

Now his presidency is being reevaluated and his message reborn in a political moment reminiscent of the post-Watergate distrust and disillusionment that got him to Washington four decades ago, and could well carry another Democrat with a similar message to victory in 2020.