President Donald Trump addresses a meeting of the National Space Council in the East Room of the White House in Washington, June 18, 2018.

U.S. President Donald Trump told Republican lawmakers on Tuesday he would back either of the immigration bills making their way through the House of Representatives, as the outcry grew over his administration's separation of immigrant parents and children at the U.S.-Mexico border.

Representative Mark Meadows said Trump told Republican members of the House at a meeting on Capitol Hill that they needed to get something done on immigration "right away."

In the meeting, Trump said separating families was "certainly not an attractive thing and does look bad," added Representative Tom Cole.

Congressional Republicans have been scrambling to craft legislation as videos of youngsters in cages and an audiotape of wailing children have sparked anger at home from groups ranging from clergy to influential business leaders, as well as condemnation abroad.

A Reuters/Ipsos national opinion poll released on Tuesday showed fewer than one in three American adults supporting the policy. The June 16-19 poll found that 28 percent of people polled supported the policy, while 57 percent opposed it and the remaining 15 percent said they did not know.

Trump, who has made a tough stance on immigration a centerpiece of his presidency, has staunchly defended his administration's actions. He has cast blame for the family separations on Democrats, although his fellow Republicans control both chambers in Congress and his own administration implemented the current policy of strict adherence to immigration laws.

The president has sought to link an end to the family separations to passage of a wider bill on immigration, which would include funding for his long-sought border wall with Mexico, prompting Democrats to accuse him of using children as hostages.

"In his remarks, he endorsed both House immigration bills that build the wall, close legal loopholes, cancel the visa lottery, curb chain migration, and solve the border crisis and family separation issue by allowing for family detention and removal," White House spokesman Raj Shah said of Trump.

An unidentified person yelled an obscenity at the president before he entered the meeting.

Earlier on Tuesday, the president tried again to blame Democrats for what he called "loopholes" in the law that require families detained for entering the country illegally either to be separated or released.

"These are crippling loopholes that cause family separation, which we don't want," he said in remarks to the National Federation of Independent Business, adding he wanted Congress to give him the legal authority to detain and deport families together.