President Trump on Sunday explicitly advocated for depriving undocumented immigrants of their due-process rights, arguing that people who cross the border into the United States illegally are invaders and must immediately be deported without trial or an appearance before a judge.

Trump’s attack on the judicial system sowed more confusion as lawmakers struggle to reach consensus on immigration legislation and as federal agencies scramble to reunite thousands of migrant children and their parents who were separated at the border under an administration policy that the president abruptly reversed last week.

The House is preparing to vote this week on a broad Republican immigration bill. Although the White House supports the proposed legislation, prospects for its passage appeared dim Sunday, both because Democrats oppose the measure and because Republicans have long been divided over how restrictive immigration laws should be.

Meanwhile, some GOP lawmakers were preparing a more narrow bill that would solely address one of the flaws in Trump’s executive order, which mandates that migrant children and parents not be separated during their detention. The 1997 “Flores settlement” requires that children be released after 20 days, but the GOP proposal would allow for children and their parents to stay together in detention facilities past 20 days.

At the center of the negotiations is a president who has kept up his hard-line rhetoric even as he gives contradictory directives to Republican allies. In a pair of tweets sent late Sunday morning during his drive from the White House to his Virginia golf course, Trump described immigrants as invaders, called U.S. immigration laws “a mockery” and wrote that they must be changed to take away legal rights from undocumented migrants.

“We cannot allow all of these people to invade our Country,” Trump wrote. “When somebody comes in, we must immediately, with no Judges or Court Cases, bring them back from where they came. Our system is a mockery to good immigration policy and Law and Order. Most children come without parents.”

The president continued in a second tweet: “Our Immigration policy, laughed at all over the world, is very unfair to all of those people who have gone through the system legally and are waiting on line for years! Immigration must be based on merit — we need people who will help to Make America Great Again!”

Trump also exhorted congressional Democrats to “fix the laws,” arguing that “we need strength and security at the Border! Cannot accept all of the people trying to break into our Country.”

Trump reiterated his call to turn people away in tweets on Monday, writing that immigrants should “simply be stopped at the Border and told they cannot come into the U.S. illegally.”

After House Republicans failed to pass a hard-line immigration bill last week, they were preparing to vote on another broad bill this week that would provide $25 billion for Trump’s long-sought border wall, limit legal immigration and give young undocumented immigrants a path to citizenship.

“I did talk to the White House yesterday. They say the president is still 100 percent behind us,” Rep. Michael McCaul (R-Tex.), a co-sponsor of the bill, said on “Fox News Sunday.”

But because that bill may not garner enough votes to pass the House, momentum was building over the weekend for a more narrow measure that would effectively end the Flores settlement. Should the broader bill fail, the White House is preparing to throw its support behind the measure, which is expected to garner wider backing among lawmakers, according to a White House official.

Legislative negotiations are continuing behind the scenes despite Trump’s vacillations over the past week. The president began the week defending his administration’s family separation policy. On Tuesday night, he expressed support for two rival GOP bills in a muddled and meandering address to House Republicans in which he insulted Rep. Mark Sanford (R-S.C.) without prompting, drawing a smattering of boos. Then on Friday, he urged lawmakers to throw in the towel, tweeting, “Republicans should stop wasting their time on Immigration until after we elect more Senators and Congressmen/women in November.”

That tweet demoralized Republicans as they headed home for the weekend, but it did not end talks about what the House might pass. Brendan Buck, counselor to House Speaker Paul D. Ryan (R-Wis.), said Sunday that a solution specifically dealing with family separation had been “a topic of discussion all week,” although he noted that there was not one policy or bill that Republicans had coalesced behind.

Marc Short, the White House director of legislative affairs, said Sunday that it was premature to announce which measures Trump would sign but urged Congress to act quickly to address the immigration issue broadly.

“The White House has consistently raised our concern about the Flores settlement with Congress,” Short said. “It’s, in fact, an issue that previous administrations grappled with also, and we anticipate Congress acting on that sooner rather than later.”

Meanwhile, Trump’s attack on the due-process rights of immigrants follows a week in which he has been fixated on the immigration court system, which he has called “ridiculous.” The president has balked at proposals from Sen. Ted Cruz (R-Tex.) and other lawmakers to add court personnel to help process more immigration cases.

Democrats and immigrant rights advocates sought to shame Trump for saying he wants to deny those in the country illegally their due-process rights.

Omar Jadwat, director of the American Civil Liberties Union’s Immigrants’ Rights Project, said in a statement: “What President Trump has suggested here is both illegal and unconstitutional. Any official who has sworn an oath to uphold the Constitution and laws should disavow it unequivocally.”

And at least one GOP lawmaker spoke out against Trump’s threat. Rep. Justin Amash (Mich.), a libertarian-leaning Republican who has often criticized the president, responded to the controversy by quoting the Fifth Amendment.

“No person shall be . . . deprived of life, liberty, or property, without due process of law,” Amash tweeted.

Trump has been beating this drum for several days now. In a speech Tuesday, Trump said: “I don’t want judges. I want border security. I don’t want to try people. I don’t want people coming in.”

“Do you know, if a person comes in and puts one foot on our ground, it’s essentially, ‘Welcome to America, welcome to our country’?” Trump continued. “You never get them out, because they take their name, they bring the name down, they file it, then they let the person go. They say, ‘Show back up to court in one year from now.’ ”

Trump suggested in those remarks, delivered before the National Federation of Independent Businesses, that many immigrants were “cheating” because they were following instructions from their attorneys.

“They have professional lawyers,” he said. “Some are for good, others are do-gooders, and others are bad people. And they tell these people exactly what to say.”

Many immigration hard-liners see it differently. Asylum applications and deportation proceedings go before immigration courts, staffed by judges who can make rulings without consulting juries.

Cruz’s initial legislation on the border crisis proposed doubling the number of immigration judges, to 750 from roughly 375. And Attorney General Jeff Sessions has taken steps to strengthen the immigration courts, allowing them to process many cases without trials and limiting their ability to delay other cases.

“I have sent 35 prosecutors to the Southwest and moved 18 immigration judges to the border,” Sessions told an audience in San Diego earlier this year. “That will be about a 50 percent increase in the number of immigration judges who will be handling the asylum claims.”

While wrestling with their own response, Republicans have shifted blame to Democrats, who have been critical of both Sessions’s moves and drafts of immigration legislation. In a Sunday afternoon tweet, Senate Minority Leader Charles E. Schumer (D-N.Y.) argued for “a czar to break through the bureaucracy and get these kids out of limbo and back in their parents’ arms.”

On the Sunday political talk shows, Republicans echoed Trump in accusing Democrats of rejecting any serious solution in favor of inflicting political hurt — and charging that they want “open borders.”

“Chuck Schumer says, ‘No, no, no, we’re not going to bring it up,’ ” Rep. Jim Jordan (R-Ohio), a leader of the House Freedom Caucus, said on CBS’s “Face the Nation.” “What they want is the political issue. They don’t want to solve the problems. They don’t want to keep families together and adjudicate this and have a go through the hearing process and do it in a way that’s consistent with the rule of law.”

Meanwhile, Defense Secretary Jim Mattis on Sunday said the Defense Department is working on details of a plan to house migrants at two military bases in the United States. Speaking to reporters en route for a visit to Alaska, Mattis said the Pentagon had received a request from the Department of Homeland Security to receive migrants and is finalizing how many people would need to be housed and what they would require.

Mattis said the Pentagon’s role is limited and compared it to the department’s housing of migrants from Vietnam and people displaced by natural disasters.

“We’re in a logistics support response mode to the Department of Homeland Security,” he said.

Philip RuckerPhilip Rucker is the White House Bureau Chief for The Washington Post. He previously has covered Congress, the Obama White House, and the 2012 and 2016 presidential campaigns. Rucker also is a Political Analyst for NBC News and MSNBC. He joined The Post in 2005 as a local news reporter. Follow

David WeigelDavid Weigel is a national political correspondent covering Congress and grass-roots political movements. He is the author of "The Show That Never Ends," a history of progressive rock music. Follow