Senator Lindsey Graham, Republican of South Carolina, floated the idea of a broader immigration deal during the meeting in the White House Cabinet Room on Tuesday, making clear that it would have to include a pathway to citizenship for undocumented immigrants already in the country.
Mr. Trump replied: “If you want to take it that further step, I’ll take the heat. I will take all the heat. You are not that far away from comprehensive immigration reform.”
Lawmakers from both parties were taken aback by the president’s words.
“My head is spinning with all the things that were said by the president and others in that room in the course of an hour and a half,” said Senator Richard J. Durbin, Democrat of Illinois, who has been leading the talks.
The president has been known to make conflicting or contradictory statements on complex policy issues, only to walk them back or change his mind. White House officials declined to provide specifics about what kind of immigration overhaul the president would favor, saying he was focused on the shorter-term measure that would shield undocumented immigrants brought to the country as children from deportation, in exchange for more border agents and a down payment on a border wall.
Hours after the meeting, Mr. Trump appeared to harden his insistence on the wall, writing on Twitter, “As I made very clear today, our country needs the security of the Wall on the Southern Border, which must be part of any DACA approval.”
But the comments earlier Tuesday were a remarkable break with the divisive messaging that propelled Mr. Trump to the White House and the harsh policies that have defined his first year in office, marked by efforts to demonize and deport immigrants who have entered the country illegally.
The administration has also moved to curtail legal channels for immigration like refugee resettlement and temporary protections for vulnerable groups, including Salvadorans who have been allowed to live and work legally in the United States after earthquakes struck their country in 2001.
Instead, the president presented himself on Tuesday as a deal maker eager to find common ground and unconcerned with — if not blithely unaware of — the political perils of immigration debates. The phrase “comprehensive immigration reform” is detested by anti-immigration activists.
“I don’t think it’s going to be that complicated,” Mr. Trump told lawmakers assembled around his cabinet table of a broad immigration measure.
Republican senators were deeply skeptical.
“I don’t think comprehensive reform is as imminent as he would think it could be,” Senator Charles E. Grassley of Iowa said after returning from the White House.
Senator David Perdue, Republican of Georgia, cautioned against talk of a far-reaching deal. “I don’t like the word ‘comprehensive,’” he said. “That hasn’t worked as it relates to immigration.”
Mr. Trump’s call for a comprehensive solution came just after Mr. Graham had said he was a proponent of “a pathway to citizenship for 11 million people,” and then predicted “a drumbeat” of vitriol against such an approach. “Right-wing radio and talk show hosts are going to beat the crap out of us,” he said “It’s going to be ‘amnesty’ all over again.”
Mr. Trump seemed almost to relish such a fight.
“My whole life has been heat,” he shrugged. “I like heat, in a certain way.”
The White House meeting itself was extraordinary, an extended negotiating session that was broadcast by the news channels at a time when questions about Mr. Trump’s mental acuity and fitness for his job have been dominating the headlines.
The president appeared to signal a willingness to compromise with Democrats on the border security provisions that he says must be part of a near-term agreement to codify the protections created under DACA, or Deferred Action for Childhood Arrivals, the Obama-era program that he has moved to end by March that shields from deportation those brought to the United States illegally as children.
He called it a “bill of love,” echoing the language of Jeb Bush, one of his rivals for the Republican nomination in 2016 whom he once ridiculed. On Tuesday, Mr. Bush praised the president for seeking a bipartisan solution, while immigration hard-liners ridiculed Mr. Trump for sounding like the former Florida governor.
“Donald J. Trump,” read one slogan circulated by a prominent anti-immigration expert, Mark Krikorian, showing a scene from Tuesday’s meeting. “(The “J” is for ¡Jeb!)”
Nearly 800,000 young undocumented immigrants were shielded from deportation under the DACA program, which granted them renewable two-year work permits. Immigrant rights advocates say 14,000 of the young people have already lost their protected status because their permits have expired, and they have been unable to renew them.
Lawmakers returning from the White House meeting said Democrats and Republicans had agreed on four topics to be negotiated as part of a narrower DACA deal: the fate of beneficiaries of the program, border security, family-based immigration and the visa lottery. A handful of Democrats and Republicans have been meeting for months to try to hammer out a deal along those lines, and the president’s backing of that scope was a startling shift for them.
“I was pleasantly surprised,’’ said Senator Jeff Flake, Republican of Arizona, who has participated in those negotiations. “It was a better meeting than I expected. You can’t negotiate that much with that many people but the president expressed flexibility.’’
Still, Congress has a lot of work ahead on these areas before lawmakers come to a deal that everyone can agree on.
During the session, Mr. Trump repeatedly went back to his call for a broad and comprehensive immigration bill, even as Democratic and Republican lawmakers cautioned him of the failures of the past. Some Republicans pointedly said Mr. Trump was being too ambitious. Even Democrats worried that more immediate immigration matters might fail to pass with the broader package now on the table.
“The fierce urgency of now is for these 800,000 Dreamers,” said Senator Robert Menendez, Democrat of New Jersey, referring to the nickname for the young immigrants now in limbo.
Democrats have insisted that protections for those immigrants be part of any agreement to fund the government beyond Jan. 19, when current funding expires.
But the president said action on the more ambitious immigration measure would be possible as soon as the next day.
“We can do DACA and start comprehensive reform the following afternoon,” Mr. Trump said. “We will take an hour off and start.”
Previous attempts to enact such a broad bipartisan immigration compromise during the Bush and Obama presidencies proved politically impossible. After months of arduous negotiations, comprehensive immigration bills passed the Senate in 2006 and in 2013 only to be stymied in the House.
“You created an opportunity here, Mr. President,” Mr. Graham said to Mr. Trump, “and you need to close the deal.”
The president’s pivot drew swift rebukes from conservatives and immigration activists who have been among Mr. Trump’s staunchest supporters.
Roy Beck, the executive director of NumbersUSA, which pushes for reducing immigration, said the deal that Mr. Trump envisioned, like previous grants of amnesty, would bolster both illegal and legal immigration levels, flooding the American labor market.
“Amnesty-now and enforcement/reform-later agreements always fail the American people,” Mr. Beck said in a statement. “President Trump must hold fast to his compact with American workers to greatly reduce both the illegal and legal competition from mass migration.”
The president said he would insist on strict new immigration limits as part of any such measure, although he seemed to concede that his call for a “wall” might not entail the kind of physical barriers that many Democrats have viewed as a nonstarter.
He conceded that “We don’t need a 2,000-mile wall” because parts of the border are impassible and noted that Democrats had voted for border fencing in the past. Afterward, Republicans and Democrats both said they believed Mr. Trump was using the term “wall” to describe border security, not necessarily a giant physical barrier.