In a major diversion from his typical hardline talk, President Donald Trump on Tuesday told congressional lawmakers he was open to signing comprehensive reform measures that would provide a pathway to citizenship for undocumented immigrants.

“If you want to take it that further step, I’ll take the heat,” the president told Sen. Lindsey Graham (R-S.C.), who said he had been working for 10 years on that very issue. “You are not that far away from comprehensive immigration reform.”

Trump made the comments during a meeting at the White House with a bipartisan group of lawmakers who are working to come up with a deal to protect from deportation the 800,000 undocumented immigrants covered by the Deferred Action for Childhood Arrivals program. Per a directive Trump issued in September, DACA will expire in March unless Congress acts.

Reporters were allowed to stay in the meeting for almost an hour as the lawmakers discussed immigration reform.

Trump laid out a two-pronged approach during the meeting, saying Congress should tackle DACA and border security first before moving on to comprehensive immigration reform.

The president said he would sign a “clean DACA bill” so long as it also covered border security, which apparently includes his long-promised border wall he once said Mexico would pay for. Both Democrats and a number of Republicans reject that move.

“To me, a clean bill is a bill of DACA, we take care of them, and we also take care of security,” Trump said Tuesday afternoon. “And the Democrats want border security, too. ... Everyone wants security. Then we go to comprehensive later on. And maybe that is a longer subject and a bigger subject, and I think we can get that done, too.”

Trump has reportedly asked Congress to approve $18 billion in funds for the wall, an ask Democrats oppose and one that could scuttle a DACA deal.

He said it is “vital” that the DACA fix be bipartisan, saying it should be a “bill of love.”

“But it also has to be a bill where we’re able to secure our border,” Trump said. “Drugs are pouring into our country at a record pace. A lot of people coming in that we can’t have.”

Trump said he also wants immigration provisions that Democrats will be loathe to accept. This includes funding for the border wall, an end to so-called “chain migration” and an end to the visa lottery system.

“Countries come in and put names in a hopper,” Trump said of the lottery program. “They’re not giving you their best names — common sense tells you they’re not giving you their best names. They give you people that they don’t want and then we take them out of the lottery. When then [sic] do it by hand, put the hand in a bowl and what’s in the hand are the worst of the worst. They put people that they don’t want in the lottery and the United States takes those people.”