President Trump said Wednesday he wants to work with Democratic leaders in Congress on a permanent immigration deal in which young illegal immigrants facing deportation “don’t have to worry about it anymore.”

After meeting at the White House with the top congressional leaders of both parties, Mr. Trump told reporters that he’s hopeful he can reach a deal with Senate Minority Leader Charles E. Schumer of New York and House Democratic Leader Nancy Pelosi of California, who earlier in the day had called the president cowardly and “brainless” for ending an amnesty program for young illegal immigrants.

“Chuck and Nancy would like to see something happen, and so do I,” Mr. Trump said aboard Air Force One. “And I said if we can get something to happen, we’re going to sign it, and we’re going to make a lot of happy people.”

Asked if an immigration deal would include a pathway to citizenship for illegal immigrants, the president replied, “That’s going to be discussed later, but we want to talk about legal [immigration] right now. We haven’t discussed that.”

He said conservative lawmakers also want to find a solution for the 800,000 so-called “Dreamers” who came to the U.S. illegally as children with their families. Mr. Trump on Tuesday ended the Deferred Action for Childhood Arrivals, DACA, program that was started by President Obama in 2012.

“I think Congress really wants to do this,” Mr. Trump said. “I’d like to see something where we have good border security, and we have a great DACA transaction where everybody is happy, and now they don’t have to worry about it anymore because, obviously, as you know, before, it was not a legal deal. It was a deal that wouldn’t have held up and didn’t hold up.”

Mr. Trump and Attorney General Jeff Sessions said Tuesday they had no choice but to phase out DACA because it likely would be ended by the courts. The White House said “dreamers” will not be targeted for deportation, but they most will lose their work permits granted under the program.

“I’d like to see a permanent deal, and I think it’s going to happen,” Mr. Trump said. “I think we’re going to have great support from both sides of Congress, and I really believe that Congress is going to work very hard on the DACA agreement and come up with something.”