The Biden administration announced Thursday that it is ready to re-implement the Trump-era "Remain-in-Mexico" policy in response to a court order to do so, after making changes to secure the agreement of the Mexican government – while still seeking to abolish the program entirely.

"As required by a federal court order, the Department of Homeland Security (DHS) has been working in good faith to re-implement the Migrant Protection Protocols (MPP) program," the Department of Homeland Security said in a statement. "Today, in coordination with the Departments of State and Justice, DHS announced key changes to MPP to address humanitarian concerns raised by the Government of Mexico and shared by the U.S. Government."

DHS SAYS IT ANTICIPATES RESTARTING TRUMP-ERA ‘REMAIN IN MEXICO’ POLICY IN NOVEMBER, IS REBUILDING COURT TENTS

Remain-in-Mexico-border-Trump-Scotus

SAN LUIS, AZ - AUGUST 15: Migrants attempting to cross in to the U.S. from Mexico are detained by U.S. Customs and Border Protection at the border August 15, 2021 in San Luis, Arizona. (Photo by Nick Ut/Getty Images)

The Biden administration had abolished the program, known officially as the Migrant Protection Protocols (MPP), earlier this year. The program, set up and expanded in 2019, kept migrants in Mexico while migrants awaited their hearings rather than being released into the U.S. interior. It saw the construction of court tents along the southern border which migrants would enter for their proceedings.

The Trump administration hailed it as a key cog in its efforts to end "catch-and-release" and stem the flow of migrants that had surged into the U.S. that year. Opponents have said the policy was cruel and puts migrants at risk of violence and exploitation in Mexico. The Biden administration began unraveling the program shortly after entering office, and shut it down entirely in June.

But a federal court order, upheld by the Supreme Court, ordered the Biden administration to re-implement the program after Missouri and Texas argued that the policy had not been rescinded lawfully.

BIDEN ADMIN MOVES TO END MIGRANT PROTECTION PROTOCOLS, ADMITS IT ‘LIKELY’ HELPED REDUCE ILLEGAL MIGRATION

The Biden administration is now working to end the policy in a way that would not be subject to legal challenge -- including having conducted a full review of the effects of ending the program -- but in the meantime in re-implementing the policy. Homeland Security Secretary Alejandro Mayorkas issued a memo to formally end the program in October, and DHS emphasized on Thursday that he "repeatedly stated that MPP has endemic flaws, imposed unjustifiable human costs, pulled resources and personnel away from other priority efforts, and failed to address the root causes of irregular migration." 

On Thursday the administration said the changes it is making to the program to satisfy Mexico's concerns include making sure that cases are concluded within six months, opportunities for legal assistance, more information to enrollees and the exclusion of "particularly vulnerable individuals." Those enrolled will also be offered (but not mandated) COVID-19 vaccines.

"The U.S. Government will work closely with the Government of Mexico to ensure that there are safe and secure shelters available for those enrolled in MPP; that individuals returned under MPP have secure transportation to and from U.S. ports of entry; and that MPP enrollees are able to seek work permits, healthcare, and other services in Mexico," the statement said.

Hours later, the Mexican government said in a statement that, because of the changes, "for humanitarian reasons and on a temporary basis, the Government of Mexico has decided that it will not return to their home countries certain migrants who have an appointment to appear before an immigration judge in the United States to request asylum there."  

The Biden administration has been preparing for the re-implementation of the program for months. In October, it said in a court filing that it had finalized operational plans and has also issued a task order to rebuild the soft-sided facilities (which were commonly referred to as "court tents") in Laredo and Brownsville, Texas to the tune of $14.1 million -- with a predicted $10.5 million a month in operational costs.

The return of the policy marks a blow for the Biden administration, which had sought to end a slew of Trump-era policies rapidly after entering office. Republicans have skewered the administration, linking the rollback with the surge in migration at the southern border which overwhelmed authorities and saw more than 1.7 million migrant encounters in Fiscal Year 2021 – an outcome they had predicted for months.

House Republican Leader Kevin McCarthy, in a statement to Fox News, said that "President Biden’s failures have enabled the border crisis to rage on."

"Nine months ago, I laid out five immediate solutions the Biden administration could implement to stop the border crisis, one of which included reinstating the ‘Remain in Mexico’ policy. Instead, he chose inaction," he said.

"It is unfortunate that it took litigation to force the Biden administration’s hand to apply this commonsense measure, as his own policies have jeopardized our national security and created an untenable situation at the border," he said. "It serves as more proof of President Biden’s incompetence that has led our nation to face crisis after crisis."

"For months, I have been urging the administration to reinstate successful border policies like Remain In Mexico," Rep. Tony Gonzales, R-Texas, said in a statement. "Maybe if they had listened earlier, our border crisis wouldn’t be this dire."

CLICK HERE TO GET THE FOX NEWS APP

Meanwhile, some Democrats expressed dismay at the reinstatement of the policy. Sen. Bob Menendez, D-NJ, said he was "deeply concerned that they are overseeing an expansion of this inhumane policy and implementing the court’s order before critical safeguards are in place."

"We cannot externalize our asylum system and abandon our obligations as a beacon of hope and opportunity," he said. "We urge the Biden-Harris Administration to make every effort to reduce the harm of this court order and ensure the end of this xenophobic and anti-immigrant policy for good."

Fox News' Edward Lawrence contributed to this report.