The Trump Administration announced rules that migrants coming from Central America who have passed through other countries en route to the U.S. border will no longer be able to make a claim for asylum beginning July 16. Immigration attorneys and experts say the rule is a violation of domestic and international asylum laws, and federal judge has sided with the administration in one of two cases brought against the new rule.

On July 15, the Trump Administration announced the change to asylum rules making it so that migrants had to have made an asylum claim at a previous country while en route to the U.S. before arriving to the southern border — anyone who hasn’t becomes ineligible for asylum in the U.S.

In response, groups working with migrants have been highly critical. Legal experts say the new rule violates both domestic and international law. The ACLU announced on July 16 that it had filed a lawsuit against the Trump Administration. On July 15, an ACLU official told TIME it would seek an immediate injunction.

“We have been expecting something along these lines for some time now,” Lee Gelernt, deputy director of the Immigrants’ Rights Project at the ACLU, tells TIME. “We believe that the rule is an end run around the asylum laws Congress has passed and should be invalidated as inconsistent with the immigration statute.”

Capital Area Immigrants’ Rights (CAIR) and Refugee and Immigrant Center for Education and Legal Services (RAICES) attempted to sue the Trump Administration, represented by international law firm Hogan Lovells.

On Wednesday, a federal judge sided with the Trump Administration in the Lovells case against the new rule, the same day a judge in San Francisco hears arguments in the case brought by the ACLU.

In a public statement July 16, RAICES executive director Jonathan Ryan said, “Regardless of where they began their journey, many of the individuals entering our southern border have legitimate claims for asylum in the United States…This Rule creates yet another barrier to the right to seek protection that is guaranteed under both federal and international law.”

In a public statement, Attorney General William Barr called the rule a lawful exercise of authority provided by Congress.

“The United States is a generous country but is being completely overwhelmed by the burdens associated with apprehending and processing hundreds of thousands of aliens along the southern border,” Barr said in a statement. “This Rule will decrease forum shopping by economic migrants and those who seek to exploit our asylum system to obtain entry to the United States—while ensuring that no one is removed from the United States who is more likely than not to be tortured or persecuted on account of a protected ground.”

However, Elora Mukherjee, a professor of law at Columbia University and director of Columbia Law School’s Immigrants’ Rights Clinic, tells TIME the White House does not have the authority to change laws established by Congress.

“In our system of checks and balances, the code of federal regulations cannot be overwritten by executive fiat,” Mukherjee says. “The President can’t just rewrite the law.”

How exactly does this new policy violate domestic and international law?

Trump’s new rule says a migrant who wants to make an asylum claim in the U.S. must first have had to apply for asylum in either a neighboring country from where the migrant is from, or from at a country en route to the U.S. even though Congress has established rules that say a migrant cannot be barred from seeking asylum in the U.S. based on where they are from.

“This president, this administration, is trying to end asylum,” Mukherjee says. “This rule is another move to turn refugees with well founded fears of persecution back to places where their lives would be in danger.”

The ACLU argues that the Trump Administration has violated the rules set in place by Congress on establishing a “safe third country.”

In the Immigrant Nationality Act, Congress established that the U.S. can enter into “safe third country” agreements with other nations. The agreement would make it so that the third country would process asylum claims instead of the U.S. Though Trump has discussed establishing third country agreements with Guatemala and Mexico, only one agreement currently exists and it’s with Canada.

“So this is actually a run around of the safe third country agreement,” Kennji Kizuka, Senior Researcher and Policy Analyst at Human Rights First, tells TIME. “Instead of reaching one of those agreements, what the administration is doing is punting people back to any third country that they potentially have passed through.”

“From our view, Congress already laid out the procedures to address asylum seekers who have passed through third countries or who have already been granted some form of protection or status in another country, and this isn’t it, this violates what Congress wrote out in the statute already,” Kizuka added.

Internationally, the rule does not fall in line with what the UNHCR, the UN Refugee Agency, details as conditions for a safe third country agreement, according to Kizuka. He added the U.S. might begin seeing lawsuits from countries and international courts such as the Inter American Court of Human Rights should the U.S. begin returning migrants to unsafe countries.

In a Monday statement, the UNHCR said the new rule is not in line with international obligations, and said it raises the burden of proof on asylum seekers who have to prove persecution to government officials beyond the international legal standard.

“We understand that the U.S. asylum system is under significant strain. And we are ready to play a constructive role if needed in helping alleviate this strain,” UN High Commissioner for Refugees Filippo Grandi said. “But we are deeply concerned about this measure… It will put vulnerable families at risk. It will undermine efforts by countries across the region to devise the coherent, collective responses that are needed. This measure is severe and is not the best way forward.”

The UNHCR added that many of the people leaving parts of Central America face “extreme economic deprivation,” gang violence, persecution and are in need of international protection.

The Mexican government also addressed the new U.S. asylum rule in a statement on Monday, saying it disagrees with the Trump Administration and will not change it’s own asylum rules.

“Mexico does not agree with measures that limit access to asylum and refuge for people who fear for their lives or safety in their country of origin,” Mexico’s Secretary of Foreign Affairs Marcelo Ebrard Casaubón said in a public statement. Ebrard urged the U.S. not to send asylum seekers back to countries where they fear persecution.

What happens to the people waiting to make an asylum claim at the Southern border?

Anyone who is already in the country and has made an asylum claim will not be effected by this new rule. But for the thousands along the southern border who are stranded in Mexico and have been waiting to apply for asylum, the future is uncertain.

“Countries have to agree to take back these individuals that have passed through their borders,” Kizuka says. “It may be that El Salvador, Honduras, Guatemala — other countries where people have transited — are just not willing to receive asylum seekers.”

Mukherjee says she has witnessed the amount of people who have waited to make an asylum claim at a U.S. port of entry while visiting Tijuana in January. She called the situation and the new law “devastating.”

“In so many countries around the world, immigrants are targets of very serious anti-immigrant violence,” Mukherjee says. “They’re subject to attacks, and it’s just going to put lots of asylum seekers in harms way.”

Write to Jasmine Aguilera at jasmine.aguilera@time.com.