An appeals court in California has temporarily halted the Trump administration’s policy forcing asylum seekers to wait in Mexico as the United States considers their cases.

The Ninth Circuit Court of Appeal’s decision on the controversial programme – known as the “remain in Mexico” programme – marks a significant blow to one of the administration’s key asylum policies, which went into effect in January of last year.

Under the programme, asylum seekers who are from Central America were forced to stay on the Mexican side of the border as they awaited their court dates. Since the programme was enacted, around 59,000 people had been enrolled in the programme, which is formally known as the Migrant Protection Protocols (MPP) programme, US Customs and Border Protection commissioner Mark Morgan said on Thursday.

In their legal arguments, the Trump administration said that the policy had led to a drop in arrests at the border, and therefore showed success. Immigrant advocates, meanwhile, said that the programme put vulnerable migrants into harms way in makeshift camps along the border with little if any oversight.

The three-judge court, in its decision, called the policy “invalid in its entirety”, and said a lower court decision that had initially enjoined its implementation was “not an abuse of discretion”.

People strike across America for A Day Without Immigrants Show all 16 1 /16 People strike across America for A Day Without Immigrants People strike across America for A Day Without Immigrants Demonstrators march during the "Day Without Immigrants" protest in Chicago, Illinois, February 16, 2017. Theopolis Waters/Reuters People strike across America for A Day Without Immigrants Demonstrators march during the "Day Without Immigrants" protest in Washington, DC, U.S., February 16, 2017. Aaron P. Bernstein/Reuters People strike across America for A Day Without Immigrants Protesters march in the streets outside the Texas State Capital on 'A Day Without Immigrants' February 16, 2017 in Austin, Texas. The crowd, which grew to well over a thousand participants, marched from the Austin City Hall to the Texas State Capital. Across the country hundreds of restaurants and eateries are closing for the day to protest President Trump's immigration policies and to highlight the contributions of immigrants to U.S. business and life. Drew Anthony Smith/Getty People strike across America for A Day Without Immigrants Protesters march in the streets outside the Texas State Capital on 'A Day Without Immigrants' February 16, 2017 in Austin, Texas. Drew Anthony Smith/Getty People strike across America for A Day Without Immigrants AUSTIN, TX - FEBRUARY 16: Protesters march in the streets outside the Texas State Capital on 'A Day Without Immigrants' February 16, 2017 in Austin, Texas. Drew Anthony Smith/Getty People strike across America for A Day Without Immigrants Demonstrators march during the "Day Without Immigrants" protest in Chicago, Illinois, February 16, 2017. Theopolis Waters/Reuters People strike across America for A Day Without Immigrants Demonstrators march during the "Day Without Immigrants" protest in Chicago, Illinois, February 16, 2017. Aaron P. Bernstein/Reuters People strike across America for A Day Without Immigrants Protesters march in the streets outside the Texas State Capital on 'A Day Without Immigrants' February 16, 2017 in Austin, Texas. The crowd, which grew to well over a thousand participants, marched from the Austin City Hall to the Texas State Capital. Across the country hundreds of restaurants and eateries are closing for the day to protest President Trump's immigration policies and to highlight the contributions of immigrants to U.S. business and life. Drew Anthony Smith/Getty People strike across America for A Day Without Immigrants Protesters march in the streets outside the Texas State Capital on 'A Day Without Immigrants' February 16, 2017 in Austin, Texas. Drew Anthony Smith/Getty People strike across America for A Day Without Immigrants Protesters march in the streets outside the Texas State Capital on 'A Day Without Immigrants' February 16, 2017 in Austin, Texas. Drew Anthony Smith/Getty People strike across America for A Day Without Immigrants Protesters march in the streets outside the Texas State Capital on 'A Day Without Immigrants' February 16, 2017 in Austin, Texas. Drew Anthony Smith/Getty People strike across America for A Day Without Immigrants Protesters march in the streets outside the Texas State Capital on 'A Day Without Immigrants' February 16, 2017 in Austin, Texas. Drew Anthony Smith/Getty People strike across America for A Day Without Immigrants Protesters march in the streets outside the Texas State Capital on 'A Day Without Immigrants' February 16, 2017 in Austin, Texas. Drew Anthony Smith/Getty People strike across America for A Day Without Immigrants Protesters march in the streets outside the Texas State Capital on 'A Day Without Immigrants' February 16, 2017 in Austin, Texas. The crowd, which grew to well over a thousand participants marched from the Austin City Hall to the Texas State Capital. Across the country hundreds of restaurants and eateries are closing for the day to protest President Trump's immigration policies and to highlight the contributions of immigrants to U.S. business and life. Drew Anthony Smith/Getty People strike across America for A Day Without Immigrants High school student Kathia Suarez holds up a sign as she protests with others outside the Grayson County courthouse in downtown Sherman, Texas, Thursday, Feb. 16, 2017. LM Otero/AP People strike across America for A Day Without Immigrants High school senior Vicky Sosa holds a sign outside the Grayson County courthouse in downtown Sherman, Texas, Thursday, Feb. 16, 2017. In an action called "A Day Without Immigrants," immigrants across the country are expected to stay home from school, work and close businesses to show how critical they are to the U.S. economy and way of life. LM Otero/AP

“The MPP has had serious adverse consequences for the individual plaintiffs,” wrote Judge William Fletcher in the ruling released Friday. “Plaintiffs presented evidence in the district court that they, as well as others returned to Mexico under the MPP, face targeted discrimination, lack of food and shelter, and practical obstacles to participation in court proceedings in the United States.”

He continued: “The hardship and danger to individuals returned to Mexico under MPP have been repeatedly confirmed by reliable news reports.”

The flow of migrants being returned to Mexico had already dwindled in recent months, as more and more migrants were flown to Central America – especially Guatemala – and told to apply for asylum there.

But that new policy has been described as a worse condition than the already restrictive “Remain in Mexico” policy, with Charlene D’Cruz, a lawyer representing Central American asylum seekers, telling the Washington Post in a recent report that, “MPP is dying. And something worse is taking its place. Everything is changing.”

The MPP policy was put in place in order to cut down on what the Trump administration viewed as an influx of asylum seekers coming into the United States under potentially false pretences, and led to the creation of those border camps that grew in size, with kidnappings and violence following suit.

Under previous rules for asylum seekers, migrants were allowed to enter the US, apply for asylum and then wait within the country for their day in court. Donald Trump has frequently claimed that the policy allowed migrants to disappear once inside of the country, and that migrants would then skip court dates.

MPP is one of the larger steps the Trump administration has undertaken to cut down the American asylum system, alongside another plan that required migrants to apply for asylum in at least one other country along their route of travel before being allowed to apply for shelter in the US. That policy also faces a federal court challenge.