President Donald Trump, signaling a potential shift on a signature issue, has indicated that he's open to immigration legislation that would give legal status to some people living in the US illegally and provide a pathway to citizenship to those brought to the US illegally as children.

The president, in a lunch with news anchors ahead of his address to Congress on Tuesday night, said, "The time is right for an immigration bill as long as there is compromise on both sides."

A person with knowledge of the discussion confirmed his comments to The Associated Press on the condition of anonymity.

Trump campaigned as an immigration hardliner, vowing to build a wall along the US-Mexico border and pledging to step up deportations.

Since taking office, some of his policy moves have hewed closely to those promises, including new guidance from the Department of Homeland Security that would subject any immigrant in the country illegally to deportation if they are charged or convicted of any offense, or even suspected of a crime.

But the president also has suggested he is open to finding a solution for the so-called Dreamers those who were brought to the US illegally as children.

Although he railed again President Barack Obama's executive actions to protect those immigrants from deportation during the campaign, Trump has not rolled back those safeguards and has suggested he has other priorities.

During a White House news conference earlier this month, Trump said he would deal with the Dreamers with "great heart" but didn't say what his administration's policy would be.

He called their status "one of the most difficult subjects I have, because you have these incredible kids."

Immigration activist Astrid Silva, who came to the US as a child, was slated to deliver a Spanish version of the Democratic response to Trump's Tuesday night address.

Trump has flirted with a more lenient immigration policy before, saying during the campaign that he was open to "softening" his position.

But he ultimately landed where he started, declaring during a speech in September that under his presidency, there would be "no legal status or becoming a citizen of the United States by illegally entering our country."

Congress last took up immigration legislation in 2013, after Hispanic voters overwhelmingly backed Obama in his re-election campaign.

A measure including a pathway to citizenship passed the Senate, but stalled in the House.