(NewsNation) — The Supreme Court ruled the Biden administration can terminate the Trump administration’s “Migrant Protection Protocols,” also known as the “Remain in Mexico” program, which required asylum seekers at the U.S. border to wait in Mexico while their cases are processed. 

The justices, in a 5-4 ruling authored by Chief Justice John Roberts, overturned a federal appeals court decision requiring the Biden administration to restart the policy after the Republican-led states sued to maintain the program. 

Former President Donald Trump instituted the policy in 2019 to deter migrants from applying for asylum. President Joe Biden then attempted to end the policy on his first day in office. Texas and Missouri sued over the policy ending and a Texas federal judge ordered the policy be reinstated.

The Biden administration’s two efforts to rescind the program were blocked by the courts, which led to the dispute, Biden v. Texas, being appealed to the Supreme Court.

Advocacy groups said the policy subjects migrants to inhumane and dangerous conditions.

Prior to Trump’s presidency, administrations generally allowed those fleeing violence to cross the border and apply for asylum within the U.S. But under Trump, more than 70,000 asylum-seekers were returned to Mexico.

People affected by the “Migrant Protection Protocols” policy represent a small percentage of the immigration processing actions, especially after the introduction of Title 42, which had most immigrants turned away without being able to apply for asylum.

The U.S. solicitor general told the Supreme Court that the Department of Homeland Security processed more than 671,000 migrants under the traditional process in 2021. In 2020, which was the last year the “Remain in Mexico” program was in full effect, 20,000 migrants were processed under that program.

“The moment people were forced to wait in Mexico pending their asylum or deportation hearing in the United States, they stop coming,” Brandon Judd, a spokesman for the National Border Control, said Thursday on NewsNation’s “Rush Hour.”

However, humanitarians contend that sending migrants to Mexican border towns is inhumane, as they are some of the most dangerous cities in the world. That’s why they believe the policy must be done away with and replaced with a new policy that is more dignified.

“We need to establish policies that will protect our country, keep our country safe, know who’s entering our country, and provide policies that will allow people to safely and orderly enter the United States if they’re fleeing for their lives,” said Sister Norma Pimentel of the Catholic Charities of the Rio Grande Valley.

This story is developing. Refresh for updates.

The Associated Press and Border Report contributed to this report.