WASHINGTON -- U.S. President Donald Trump, signalling a potential shift on a signature issue, indicated Tuesday that he's open to immigration legislation that would give legal status to some people living in the U.S. illegally and provide a pathway to citizenship to those brought to the U.S. 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 U.S.-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 offence, 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 U.S. illegally as children. Although he railed against 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 U.S. 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.

The popularity of Trump's tough immigration message among Republican voters appeared to kill any prospect of taking up legislation during his tenure.

Senate Majority Leader Mitch McConnell said Tuesday that if Trump has an idea on immigration, "we'd be happy to take a look at it."

But immigration hard-liner Rep. Steve King of Iowa cautioned Trump against attempting to pursue comprehensive immigration legislation, calling it a "trap."

"Comprehensive is the code word for amnesty and everyone knows that by now," King said, arguing Trump needed to make good on his campaign promises including ending protections for the younger immigrants brought here illegally as kids. "If it's not going to be a promise kept on immigration the base will be gone."

On the other side, Rep. Bill Flores, R-Texas, argued that his conservative district and most of the country is ready for a solution on immigration that deals with the 11 million in the country illegally.

"I applaud the president for bringing this up," Flores said. "It's one of those areas where if you bring it up somebody's out there screaming the word amnesty at the top of their lungs and it's not amnesty, and so I think he's showed real leadership by bringing it up. I was thrilled to hear it."

As for the immigration hard-liners who've defeated past immigration efforts in the past, Flores said they didn't have Trump to contend with before.

"You've got a different president who can unleash Twitter jihad," Flores said.

Senate Minority Leader Chuck Schumer said the president has "got a lot to undo" if he wants to pursue a bipartisan plan.

"I mean, the immigrant community is rightfully scared of what President Trump has done. His executive order goes far beyond anything that anyone proposed," he told reporters. "People are cowering."

Trump's mixed signals have left many, including Deyvid Morales, a 25-year-old Dreamer from Salt Lake City, unsure about their status. Morales, who has lived in the United States since 2001, said he was optimistic about the president's new comments but unsure if he could trust him, considering Trump's hardened rhetoric throughout the campaign.

"I believe about 20 per cent of whatever he says," Morales said.

Jose Antonio Vargas, a prominent immigration activist and journalist, was invited by House Democratic leader Nancy Pelosi to be her guest at Trump's address.

He said in a column in The Washington Post that he did not accept her invitation lightly "considering the terror that the Trump administration has inflicted on immigrant families," but he wanted to send a message to the president that "undocumented immigrants live in all parts of the country, and we help make America great."

------

AP Congressional Correspondent Erica Werner and Brady McCombs in Salt Lake City contributed to this report.