WASHINGTON — The fate of 800,000 young immigrants hung in the balance Thursday as top lawmakers, White House officials and President Donald Trump himself squabbled over whether an agreement had been struck to protect them — and if so, exactly what it was.

In the face of an intense backlash from conservatives inside the Capitol and out, Speaker Paul Ryan and other GOP House members adamantly insisted that there was no agreement to enshrine protections for the immigrants brought to America as children and now here illegally.

John Cornyn of Texas, the No. 2 Senate Republican, put it this way: There was “a deal to make a deal.”

Trump himself said he was “fairly close” to an agreement that could protect the young “Dreamers” while also adding border security, as long as his long-promised wall with Mexico was also separately addressed. Democratic leaders Nancy Pelosi and Chuck Schumer — whose dinner with Trump Wednesday night was at the heart of the controversy — insisted there was discussion and even agreement on legislation that would offer eventual citizenship to the immigrants in question.

“We agreed it would be the DREAM Act,” Schumer told reporters, referring to a bipartisan bill that would allow immigrants brought here as children and now in the U.S. illegally to work their way to citizenship in as little as five years if they meet certain requirements.

But one person familiar with the meeting said the president had agreed not to the DREAM Act, but to narrower legislation that would make permanent the protections offered by President Barack Obama’s Deferred Action for Childhood Arrivals program.

What was clear was that the outcome for the “Dreamers” themselves was still unresolved and subject to much further debate and negotiation — and that the politics of immigration, which has defeated Congress for years, remained as tricky and explosive as ever. After winning the White House on a campaign that was remarkably harsh toward immigrants and revolved around construction of an enormous wall along the entire border with Mexico, Trump’s sudden pivot infuriated some of his closest allies, and seemed to contain more potential to alienate his base than any of his other unconventional moves.

“He was so explicit during the campaign on the issue of the border wall and border security that if he were to backtrack on that promise I don’t think he’d have a single friend left in the country. Democrats aren’t going to support him and he would lose the entire Republican base,” said GOP Rep. Tom McClintock of California. “This was a core explicit and graphically clear promise he made to the American people.”

“At this point, who DOESN’T want Trump impeached?” conservative commentator Ann Coulter remarked over Twitter.

Administration officials quickly recognized the danger in the backlash, and the White House shifted into damage control mode, with press secretary Sarah Huckabee Sanders denying a deal had been struck or the wall excluded from it. Some also wondered aloud on Thursday whether the president was aware of the minutiae of the DREAM Act legislation discussed on Wednesday, including the fact that it includes an eventual path to citizenship.

“We’re not looking at citizenship, we’re not looking at amnesty. We’re looking at allowing people to stay here,” Trump told reporters as he traveled to view hurricane damage in Florida.

“But very importantly, what we want: We have to have a wall,” Trump said. “If we don’t have a wall, we’re doing nothing.”

Despite Trump’s denial, two people briefed on Wednesday night’s proceedings said that citizenship was explicitly mentioned when Democrats raised the DREAM Act. Budget Director Mick Mulvaney, who was among the group dining on Chinese food (a Schumer favorite) in the White House Blue Room, spoke up to say that the bill does include a pathway to citizenship, according to the people briefed, who spoke on condition of anonymity to disclose the private proceedings.

Another person familiar with the meeting said that as the president and Schumer were going back and forth, hashing out the confines of the agreement, the president kept referencing DACA, while Schumer kept talking about the DREAM Act. After Mulvaney piped in to make clear the distinction, the president signaled he understood the difference and was talking about DACA, the person said.

Exactly what Trump and Schumer agreed to is unclear. But the posture struck by Ryan and others on Capitol Hill seemed designed to protect the president from a backlash from his conservative base. Ryan energetically disputed the idea that any deal had been struck, though his argument seemed to turn largely on semantic distinctions.

“These were discussions not negotiations, there isn’t an agreement,” Ryan said. “The president wasn’t negotiating a deal last night. The president was talking with Democratic leaders to get their perspective. I think the president understands that he’s going to have to work with the congressional majorities to get any kind of legislative solution.”

For their part, immigrant advocates and Latino lawmakers reacted cautiously, with several saying that any celebration would be premature. Many immigrants have been consumed by worry since Trump announced last week that he was ending DACA, which has granted temporary work permits and deportation relief to hundreds of thousands of immigrants brought here as minors.

In New York, Martin Batalla Vidal, who came to the U.S. with his parents when he was 7, said he’s taken college classes, does “meaningful” nursing home work and pays taxes. He spoke at a rally by civil rights groups.

Trump gave Congress six months to come up with a solution before the protections would end, although what he would actually do absent congressional action is uncertain. Despite promising to end DACA on Day One of his administration, Trump has struggled openly with the question of what to do about this sympathetic group of young immigrants.

Trump has appeared to enjoy his newfound luster as a bipartisan dealmaker since a disaster-and-debt deal he struck with Pelosi and Schumer last week stunned Washington and garnered a stack of positive headlines. Schumer, too, clearly relishes the dealmaking; he was caught on a live microphone on the Senate floor Thursday gleefully telling Majority Leader Mitch McConnell, R-Ky.: “He likes us! He likes me, anyway.”

Associated Press writers Catherine Lucey, Jonathan Lemire, Kevin Freking, Andrew Taylor, Alan Fram and Matthew Daly contributed.