President Trump told news anchors on Tuesday that he is open to a broad immigration overhaul that would grant legal status to millions of undocumented immigrants who have not committed serious crimes.

“The time is right for an immigration bill as long as there is compromise on both sides,” the president told the TV anchors at the White House, according to people present during the discussion. The people requested anonymity because they were not authorized to speak about the private meeting.

The idea is a sharp break from the broad crackdown on undocumented immigrants that Trump has taken in his first weeks in office and the hard line positions embraced by his core supporters that helped sweep him into the White House. The president hinted at the reversal just hours before he was to deliver his first address to Congress, although it was not clear whether he would mention it in his speech.

A move toward a comprehensive immigration overhaul would be a dramatic turnaround for the president, whose campaign rallies rang with shouts of “build the wall!” on the Mexican border and who signed an executive order last month directing the deportation of any undocumented immigrant who has committed a crime — whether or not they have been charged — or falsified any document. The standard could apply to virtually any one of the estimated 11 million people in the country illegally.

The White House did not dispute the report, but Sarah Huckabee Sanders, the deputy press secretary, said she had not witnessed the conversation so was unable to confirm it.

“The president has been very clear in his process that the immigration system is broken and needs massive reform, and he’s made clear that he’s open to having conversations about that moving forward,” Sanders said. “Right now, his primary focus, as he has made over and over again is border control and security at the border and deporting criminals from our country, and keeping our country safe, and those priorities have not changed.”

The president’s remarks about immigration came the day before Trump was to issue a new version his executive order banning travel to the United States from seven predominantly Muslim countries and suspending the acceptance of refugees. The ban has been revised because of legal challenges.