President Donald Trump has an unlikely defender of his approach to immigration law: former President Jimmy Carter.

Speaking to Georgia college students, the 39th president expressed optimism Wednesday that Trump might break a legislative logjam with his controversial six-month deadline for Congress to address the immigration status of 800,000-plus U.S. residents who were brought to the country illegally as children.

Carter's words may be prescient.

As the 92-year-old Democrat spoke at Emory University in Atlanta, Democratic congressional leaders Nancy Pelosi of California and Chuck Schumer of New York were huddled with the Republican Trump at the White House.

Afterward, Pelosi and Schumer announced a deal they said would protect young immigrants from deportation and grant some Republican demands on border security.

Unexpected backing: Jimmy Carter said that Trump may have opened the way to a full-scale deal on immigration which previous presidents had failed to pull off

Trump offered his own take Thursday morning via Twitter. He expressed sympathy for the young immigrants affected by the debate over the Deferred Action for Child Arrivals program, created by an executive order of President Barack Obama.

But Trump also wrote that, 'No deal was made last night on DACA. Massive border security would have to be agreed to in exchange for consent. Would be subject to vote,' he wrote.

And he maintained that a U.S.-Mexico border wall 'will continue to be built,' though Pelosi and Schumer said that's not part of any agreement.

Carter, not privy to the negotiations in Washington, told Emory students Wednesday evening that the 'pressures and the publicity that Trump has brought to the immigration issue' could eventually yield comprehensive immigration law changes that George W. Bush and Obama could not muster in their presidencies.

'I don't see that as a hopeless cause,' Carter said, and he added that Trump's critics, including himself, 'have to give him credit when he does some things that are not as bad' as they are depicted.

Carter made his remarks after correcting a student's question, submitted through Facebook, about Trump's 'decision to end DACA.'

'As a matter of fact, to give Trump some due, he hasn't ended DACA yet,' Carter said. 'What he said is he's given the Congress six months to address the issue, which is long overdue.'

Carter also noted that Trump has waffled on whether he'd actually move to deport so-called 'dreamers' if Congress doesn't act.

Among Trump's Thursday morning tweets: 'Does anybody really want to throw out good, educated and accomplished young people who have jobs, some serving in the military? Really!'

Carter reminded students that Obama, whom Carter supported, failed to win passage for the Dream Act - named for the sometimes sympathetic stories of the young immigrants - even when Obama had Democratic majorities on Capitol Hill.

Attended: Jimmy Carter and his wife Rosalynn were at President Trump's inauguration in January. He has been publicly critical of the president, but unexpectedly backed him on DACA

The former president blamed both major parties for an inability to pass any major immigration law overhaul since a 1986 law signed by President Ronald Reagan. Carter lost to Reagan in 1980.

Carter said members of his party are too reluctant to make deals on border enforcement, though the former president clarified that technological investments are better than Trump's signature campaign promise of a physical wall. Carter said Republicans are too quick to dismiss discussions of 'amnesty' for 'longtime residents.'

Beyond immigration, Carter told students he supports a single-payer health care system, and he recalled proposing a measure as president that would have phased in a 'Medicare-for-all' structure by extending benefits first to children, then to older Americans as the federal budget allowed. That did not pass.

Democratic support is growing for Sen. Bernie Sanders' proposal to extend Medicare coverage to all Americans, a trend that Carter noted. Carter said earlier this year that he voted for Sanders over Hillary Clinton in Georgia's 2016 Democratic presidential primary.

He told of collapsing earlier this year while working on a Habitat for Humanity project in Canada and being hospitalized. When he was released, he said, he asked what he owed. 'Zero,' he recalled. 'The Canadian taxpayers paid for my treatment.'

Carter acknowledged to students the considerable expense of single-payer models and the political risks for his party if they anger the private insurance industry and push the tax hikes necessary to pay for universal coverage.

Still, he concluded, 'Theoretically, it's the best system.'