President Trump on Thursday called on Congress to deliver a bipartisan deal to ensure that some younger undocumented immigrants can remain in the country without fear of deportation, but he maintained his demand for a border wall and cuts to legal immigration channels that Democrats have opposed.

“I think it can be bipartisan,” Trump said at the White House ahead of a meeting with Republican senators on immigration. “I hope it can be bipartisan. It can take care of a lot of problems; it would be really nice to do it in a bipartisan way.”

Lawmakers are facing a March 5 deadline to pass legislation to help the dreamers, immigrants brought to the country illegally as children, after Trump announced in September he would terminate an Obama-era program called Deferred Action for Childhood Arrivals (DACA) that has provided two-year work permits to hundreds of thousands of them. Nearly 700,000 dreamers had been enrolled in the program and, after March 5, nearly 1,000 per day will lose their work permits unless Congress acts.

Democrats are pushing to complete a deal on DACA by Jan. 19, when lawmaker face another deadline to secure a funding bill to keep the government open. Some Republicans, however, have resisted tying the two issues together.

“If we have support from Democrats on DACA that would be terrific,” Trump said. But the president emphasized that “any legislation on DACA must secure our border with a wall. It must give our immigration officers the resources they need to stop illegal immigration.”

He also reiterated previous calls to end a diversity visa lottery that provides 50,000 green cards a year to immigrants from countries with low immigration rates to the United States. “The lottery system has to be laughed at by people outside our country,” Trump said.

After the meeting at the White House, two Republican senators, Thom Tillis (N.C.) and James Lankford (Okla.) said in a joint statement that the lawmakers and Trump are "on the same page when it comes to security our borders once and for all and providing long-term certainty for DACA youth."

However, the senators added that "our discussions on border security and enforcement with Democrats are much further apart, and that is key to getting a bipartisan deal on DACA. Until that happens, we cannot accomplish the solutions our country needs and many families deserve."

White House press secretary Sarah Huckabee Sanders said Trump would play host to a bipartisan group of Congress members next week to continue the immigration negotiations.

Immigrant rights groups, including those that represent dreamers, have called for a “clean” DACA bill that is not attached to the spending bill and does not contain other border security provisions. Congressional Democrats have signaled they are open to some security measures, but they have steadfastly refused to support Trump's border wall, saying such a barrier is costly and unnecessary at a time when illegal crossings at the Mexican border are at records lows. Some moderate Republicans are also wary of supporting a wall.

Among the GOP senators meeting with Trump was Lindsey O. Graham (S.C.), who has been supportive of immigration reform efforts that offer a path to citizenship for undocumented immigrants. Trump, in his remarks, said Graham “used to be a great enemy of mine; now he's a great friend.”

“We're working with Democrats,” Trump added. “We're moving across the aisle. I think we have a lot of support. But we'll soon see. I'd like to take care of DACA, but only under these conditions.”