President Donald Trump said Thursday that asylum seekers must arrive at official ports of entry in order to make their claims — a departure from current U.S. law that legal experts tell TIME is very likely to be challenged.

“My administration is finalizing a plan to end the rampant abuse of our asylum system,” Trump said in a speech about immigration. “Under this plan, the illegal aliens will no longer get a free pass into our country by lodging meritless claims in seeking asylum. Instead, migrants seeking asylum will have to present themselves lawfully at a port of entry.”

The president did not release details of his proposal, but said he would announce an executive order about immigration next week. He also said he would detain migrants, including those seeking asylum, in “tent cities” near the border. Earlier in the week, the administration said it would send thousands of troops to the border; on Thursday, Trump said these troops could treat migrants who throw rocks as if they were using firearms.

“Those who choose to break our laws and enter illegally will no longer be able to use meritless claims to gain automatic admission into our country. We will hold them for a long time if necessary,” Trump said.

His comments came just days before the midterm elections, and seemed designed to excite his base as a group of Central American migrants makes its way through Mexico toward the southern U.S. border. In the weeks leading up to the election, the president and his inner circle have frequently raised concerns about the caravan.

While Trump made frequent references to the caravan during his speech Thursday — and said he wanted to stop people who “violently overrun” the border — legal experts said his proposal could potentially violate both U.S. and international law.

“The U.S. laws are quite clear on what has to happen when somebody presents at the southern border seeking asylum protection, and there isn’t really any way that an executive action can change the process,” says Denise Gilman, director of the Immigration Clinic at University of Texas Law School.

Under U.S. law, any foreign national who is in the U.S. or who arrives in the U.S. “whether or not at a designated port of arrival” may apply for asylum.

The president’s idea to limit asylum seekers to those who have arrived at designated ports of entry could particularly impact those in the most dangerous circumstances, notes Geoffrey Hoffman, director of University of Houston Law Center’s Immigration Clinic.

“Many times the asylum applicants are specifically those types of people who have been forced to flee and therefore they will not be able to avail themselves of the normal processes in their home countries,” Hoffman tells TIME.

The U.S. has also signed the U.N.’s Convention and Protocol Relating to the Status of Refugees, which means it cannot return a refugee to a country where his or her life would be threatened on the grounds of race, religion, nationality, membership in a particular social group or political opinion.

Gilman says she’s confident the president’s actions would be challenged in court “immediately,” and that she expects federal courts would invalidate changes to the asylum procedure. But she expressed concern about what would happen to those seeking asylum in the meantime.

“For at least for a matter of days, if not longer, there will be very extreme harm for asylum seekers,” she warns.

The Trump administration has already made some changes regarding who can apply for asylum this year. In June, Attorney General Jeff Sessions said that victims of domestic and gang violence would no longer qualify for asylum.

With the new plan, the president says he wants people to apply legally, but will detain them while they wait for asylum hearings. However, there is precedent for similar actions at the border being struck down, according to Elora Mukherjee, director of Columbia Law School’s Immigrant Rights Clinic.

In 2014, when there was an increase in families crossing the country’s border, the Obama administration detained families who were waiting on asylum claims. But when the administration was sued, the courts issued a preliminary injunction and forced the administration to change course.

“In that case, the Obama administration had submitted evidence from senior officials from the Department of Homeland Security claiming that these mothers and children were national security risks,” says Mukherjee. “And the federal court said ‘No, this is absurd.’ What you’re trying to do is deter future asylum seekers by detaining these asylum seekers and promising they would be rapidly deported to their home countries. And that rationale has been held impermissible.”

Get our Politics Newsletter. The headlines out of Washington never seem to slow. Subscribe to The D.C. Brief to make sense of what matters most. Please enter a valid email address. Sign Up Now Check the box if you do not wish to receive promotional offers via email from TIME. You can unsubscribe at any time. By signing up you are agreeing to our Terms of Use and Privacy Policy . This site is protected by reCAPTCHA and the Google Privacy Policy and Terms of Service apply. Thank you! For your security, we've sent a confirmation email to the address you entered. Click the link to confirm your subscription and begin receiving our newsletters. If you don't get the confirmation within 10 minutes, please check your spam folder.

Write to Abigail Abrams at abigail.abrams@time.com.