The U.S. House of Representatives on Wednesday overwhelmingly rejected a sweeping overhaul of the country's immigration policies, ignoring a last-minute appeal from President Donald Trump to approve the legislation.
The vote was 301-121, with solid Democratic opposition and a splintered Republican vote.
Republican leaders supported passage. But many of the majority bloc's most conservative lawmakers opposed the bill because they said it would create a path to citizenship for several hundred thousand young immigrants already living in the U.S. who years ago were brought illegally to the country by their parents, a provision opponents said amounts to "amnesty" for lawbreakers.
WATCH: Immigration vote
?The defeat of the legislation sets the stage for consideration in the coming days of a much narrower measure designed to put into law Trump's decision last week to halt separation of children from their parents when they have been apprehended by U.S. agents as they cross illegally from Mexico into the United States.
Last week, Trump said fellow Republicans in Congress "should stop wasting their time" considering immigration proposals until after congressional elections in November, in hopes of electing more Republicans. But in a new Twitter remark, Trump said he thought there was political gain for House Republicans to approve the wide-ranging bill.
Republicans should stop wasting their time on Immigration until after we elect more Senators and Congressmen/women in November. Dems are just playing games, have no intention of doing anything to solves this decades old problem. We can pass great legislation after the Red Wave!— Donald J. Trump (@realDonaldTrump) June 22, 2018
In a tweet using all capital letters, Trump called the measure "strong but fair," even though he said Senate Democrats "won't let it pass." But Trump said that "passage will show that we want strong borders & security while the Dems want open borders = crime. Win!"
HOUSE REPUBLICANS SHOULD PASS THE STRONG BUT FAIR IMMIGRATION BILL, KNOWN AS GOODLATTE II, IN THEIR AFTERNOON VOTE TODAY, EVEN THOUGH THE DEMS WON’T LET IT PASS IN THE SENATE. PASSAGE WILL SHOW THAT WE WANT STRONG BORDERS & SECURITY WHILE THE DEMS WANT OPEN BORDERS = CRIME. WIN!— Donald J. Trump (@realDonaldTrump) June 27, 2018
The House last week rejected tougher immigration controls, at which point Trump suggested lawmakers abandon their efforts to pass any immigration proposal.
The U.S. is holding more than 2,000 children who were separated from their parents in recent weeks, but has been slow in reuniting them with their parents in the days after Trump, in the biggest policy reversal of his 17-month presidency, ended the breakup of families at the border.
On Tuesday, in a case brought by the American Civil Liberties Union, U.S. District Judge Dana Sabraw ordered the government to return children under the age of five to their parents in the next 14 days and other minor children within 30 days.
The Justice Department said the order "makes it even more imperative" that Congress pass legislation to give border agents the ability "to simultaneously enforce the law and keep families together."
Otherwise, "lawlessness at the border will continue," the Justice Department contended.
Sabraw, appointed to the bench by Republican President George W. Bush, sharply criticized the Trump administration's handling of parent-children separations.
"Measures were not in place to provide for communication between governmental agencies responsible for detaining parents and those responsible for housing children, or to provide for ready communication between separated parents and children," he said. "There was no reunification plan in place."
In addition to ordering that the children be reunited, Sabraw said the government should take all necessary steps to facilitate regular communication between parents and children detained in separate facilities, and that parents cannot be deported without their children.
Attorney General Jeff Sessions, speaking at an event Tuesday in Los Angeles, defended the administration's immigration policies as necessary for safety and security.
"This immigration question is a decisive issue for our time. As the president often says, a country without borders is not a country," Sessions said. "I don't know why that's so hard for some people to understand. In the United States, we have the most generous immigration laws in the world."