President Trump denied Thursday that he had struck a deal with Democratic congressional leaders to address the fate of children of undocumented immigrants – insisting that any agreement would have to be tied to border security.

“No deal was made last night on DACA,” Trump said in an early morning tweet, referring to Deferred Action for Childhood Arrivals, a program established by former President Obama.

“Massive border security would have to be agreed to in exchange for consent. Would be subject to vote,” he tweeted. “The WALL, which is already under construction in the form of new renovation of old and existing fences and walls, will continue to be built.”

But on Wednesday night, Sen. Chuck Schumer (D-NY) and Rep. Nancy Pelosi (D-Calif.) – whom Trump invited for dinner at the White House — announced they had agreed on a law that would protect so-called “Dreamers.”

They said the law also would include border security, “excluding the wall.”

“We agreed to enshrine the protections of DACA into law quickly, and to work out a package of border security, excluding the wall, that’s acceptable to both sides,” they said in a joint statement after their Chinese food dinner with Trump.

On Thursday morning, Trump also heaped praise on the Dreamers.

“Does anybody really want to throw out good, educated and accomplished young people who have jobs, some serving in the military? Really!” he tweeted.

“They have been in our country for many years through no fault of their own – brought in by parents at young age. Plus BIG border security,” he added.

Under the agreement, Congress would pass the bipartisan Dream Act along with measures to enhance border security, but not funding for Trump’s border wall with Mexico, according to sources.

In a statement, the White House said Trump had “a constructive working dinner” with Schumer, Pelosi and administration officials “to discuss policy and legislative priorities,” including DACA.

White House Press Secretary Sarah Huckabee Sanders tweeted late Wednesday: “While DACA and border security were both discussed, excluding the wall was certainly not agreed to.”

Schumer spokesman Matt House tweeted that Trump was clear he still wants a wall — he just said he won’t require wall funding to be tied to Dreamers.

Wednesday night’s announcement drew immediate criticism from conservatives against the plan.

“If (the report) is correct, Trump base is blown up, destroyed, irreparable, and disillusioned beyond repair. No promise is credible,” Rep. Steve King (R-Iowa) tweeted after the news broke.