"You have 800,000 young people, brought here, no fault of their own. So we're working on a plan," Mr Trump said on Thursday, hours after he hosted a working dinner with top congressional Democrats in which they discussed securing the border in exchange for protections for immigrants known as "Dreamers."
"I think we are fairly close but we have to get massive border security."
Mr Trump's embrace of a key Democratic argument for allowing young people to stay after they arrived illegally in the United States as children was the latest stiff-arm by Trump against his own party, some of whose rank-and-file members have bridled at the president's apparent eagerness to strike deals with the opposition.
"Amnesty Don," blared a headline on Breitbart News, a far-right website run by former chief White House strategist Steve Bannon, which slammed Mr Trump for apparently selling out his base by protecting Dreamers from deportation.
Mr Trump's predecessor Barack Obama protected them through his Deferred Action for Childhood Arrivals (DACA) executive order.
Mr Trump rescinded that order, prompting jubilation among many in his camp, but then urged Congress to craft a legal solution within the next six months.
The wall
Democratic Senate Minority Leader Chuck Schumer and House of Representatives top Democrat Nancy Pelosi sounded optimistic about their meeting.
No final deal had been reached, they said, but "we agreed that the President would support enshrining DACA protections into law, and encourage the House and Senate to act," they said in a joint statement.
Negotiators will need to hash out details of border security that could include the use of drones, air support and new technology including sensors, with a mutual goal of "finalizing all details as soon as possible," the Democrats added.
They also said no funding for Trump's long-promised wall on the US-Mexico border would be in the DACA deal.
But while Democrats oppose wall funding, the president stressed that "the wall is going to be built and it will be funded later."
As the DACA discussion swirled, it appeared Mr Trump and his White House were not on the same page.
"We are not looking at citizenship. We are not looking at amnesty" of DACA immigrants, Mr Trump said in Florida, where he was surveying the aftermath of Hurricane Irma.
But a White House spokeswoman, Lindsay Walters, said the administration was considering a path to immigration reform "that could include legal citizenship over a period of time."
The working dinner was the second time in a week that Mr Trump huddled with Democrats. Last week, in a move that vexed Republican conservatives, he struck a deal with Democrats on bundling hurricane relief with raising the debt ceiling and extending government funding.
Furious
Mr Trump's apparent willingness to work with Democrats "Chuck and Nancy" rather than his own party's leaders who control Congress, and his repeated attacks on Republicans, has fueled suggestions he is striking out on his own, all too willing to leave his party in the dust.
"Frankly, this is still a reality show president" who thrives on good reviews, John Hudak, a senior fellow at the Brookings Institution, told AFP.
"He found that when he's worked with Democrats, he has gotten better reviews, better ratings," he added. "He seems inclined to continue doing that."
House Speaker Paul Ryan has expressed support for legalizing the Dreamers, but insisted Thursday that negotiations had yet to begin.
"These were discussions, not negotiations," he said of Mr Trump's talks with Pelosi and Schumer. "There isn't an agreement."
The issue has struck a chord with Mr Trump's core supporters, many of whom expected the president to hold the line on immigration.
"At this point, who DOESN'T want Trump impeached?" tweeted Ann Coulter, a firebrand conservative commentator who launched a series of broadsides against the president.
If reports of Mr Trump's DACA deal are correct, the "Trump base is blown up, destroyed, irreparable, and disillusioned beyond repair. No promise is credible," House Republican Steve King, a fierce anti-immigration advocate, said on Twitter.
Even prior to the DACA dealmaking, Mr Trump signaled an independent streak not seen in a US president in generations.
He has hammered Republicans for failing to repeal the Affordable Care Act, sacked his chief of staff Reince Priebus - a powerful former party boss - and warned Republican lawmakers he will oppose their re-election if they defy his populist agenda.