President Donald Trump announced on Thursday that his administration plans to deny asylum to thousands of immigrants, in what appears to be a last-minute attempt to invigorate his base.

But immigration experts warn the proposal is a blatant violation of international law.

Speaking from the Roosevelt Room of the White House, the president justified the new policy by pointing to a group of Central American migrants slowly making its way through southern Mexico as a looming threat to national security.

“We will not allow our generosity to be abused by those who would break our laws,” Trump said. “There’s a limit to how many people a nation can responsibly absorb into their society.”

“I will therefore take every lawful action at my disposal to solve this crisis,” Trump continued. “My administration is finalizing a plan to end the rampant abuse of our asylum system… to halt the dangerous influx and establish control over America’s sovereign borders.”

Under the plan, which Trump said would take the form of an executive order, asylum-seekers “will no longer get a free pass into our country by lodging meritless claims for asylum.”

“They will have to present themselves lawfully at a port of entry… those who choose to break our laws and enter illegally will no longer be able to use meritless claims to enter our country,” he said.

Applying for asylum is part of the legal immigration process. Asylum seekers are not legally required to present themselves at a port of entry.

The plan was light on specifics while heavy on campaign-style bluster and embellishments, making it clear this change was less about security and more about the concerted strategy by Trump to motivate anti-immigration base voters to turn out in next week’s midterm elections.

Asked for a timeline on the implementation of this plan, Trump told reporters that “we will be doing an executive order sometime next week.”

Civil rights groups and advocacy organizations have decried plans to limit the number of asylum seekers as both immoral and a flagrant violation of federal immigration law.

“Attempting to close the Southern border to migrants or asylum seekers is both legally indefensible and morally appalling,” said Melissa Crow, a senior supervising attorney with the Southern Poverty Law Center, calling the order a “Latino Ban” similar in intent to the president’s travel ban on individuals from majority-Muslim nations.

Trump’s actions “violate international human rights law,” said Michelle Brané, director of the Migrant Rights and Justice program at the Women’s Refugee Commission, and will exacerbate the administration’s current policies of intentionally undermining the asylum claims process. “This is about the continued gas-lighting of the country to perpetuate fear for political gain—and that is morally repugnant.”

U.S. Customs and Border Protection is required by federal law to allow asylum seekers who present themselves at ports of entry the chance to seek safe haven in the United States, and international treaties prohibit the United States, or any party, from returning an asylum-seeker to a country where they have a credible fear of being persecuted, tortured or killed.

The details of the executive order are hazy, beyond proposed restrictions on accepting asylum claims made by migrants who have already entered the United States, which did not lessen the outrage of advocacy groups who work on behalf of asylum-seekers.

“President Trump did not announce an immigration policy this afternoon, but repeatedly lied about the asylum system, his family separation policy, and his largely unfunded wall,” said Omar Jadwat, director of the ACLU’s Immigrants’ Rights Project. “If he plans at some point to prohibit people from applying for asylum between the ports of entry, that plan is illegal. What is clear from the timing and vague nature of today’s remarks is that he is simply trying to inflame his base in the final run-up to the midterms.”

The president’s announcement comes only five days before Tuesday’s midterm elections, where the increasing likelihood of a Democratic takeover of the House of Representatives threatens to thwart Trump’s plans to enact his anti-immigration agenda legislatively. That possibility has prompted a series of constitutionally dubious gambits in the final days of the midterm election campaign, with Trump displaying an almost myopic fixation on immigration issues as the most pressing matter facing voters.

Over the past week, Trump has called for the construction of “tent cities” for undocumented immigrants, urged the deployment of as many as 15,000 active-duty troops to the U.S. Southern border, released an advertisement linking immigration to the murder of police officers, and called for an end to birthright citizenship for the children of undocumented immigrants—a proposal that faces its own constitutional questions.

“President Trump has chosen just before midterm elections to force the military into furthering his anti-immigrant agenda of fear and division,” said Shaw Drake, policy counsel for the American Civil Liberties Union’s Border Rights Center. “This harmful action is nothing more than Trump’s latest aggression against immigrant families with children who seek our protection. These migrants need water, diapers, and basic necessities—not an army division.”

In his address Trump pointed to a caravan of several thousand migrants, which he likened to “an invasion,” as evidence that current immigration law is insufficient to prevent illegal immigration. The president has, without evidence, pegged the size of the caravan at more than 7,000 people, although Gerónimo Gutiérrez, Mexico’s ambassador to the United States, told reporters on Thursday that the number is closer to 3,500—a number that continues to shrink as members of the group pursue refugee status in Mexico.

Even members of Trump’s own administration have told The Daily Beast that the president’s claims about skyrocketing illegal immigration (actually at a four-decade low) and Middle Eastern infiltrators in the caravan are nonsense, but work well as a rallying cry for his supporters to cast ballots for candidates who will support Trump’s proposed wall along the U.S. Southern border

At a rally in Mesa, Arizona, on Oct. 19th, Trump warned that the migrants in the caravan would “break our laws, violate our borders, and overwhelm our nation” if they were to reach the United States, framing the looming confrontation in warlike terms. “You see the people come up and you listen to the fake news back there, and you’d think they’re all wonderful people! You got some bad people in those groups, you got some tough people in those group, and I’ll tell you what: This country does not want them.”

Although U.S. Customs and Border Protection’s own data show that the number of undocumented immigrants attempting to enter the United States from Mexico has stayed at roughly the same level as over the previous five years, the number of asylum-seekers from the so-called “Northern Triangle” nations of El Salvador, Guatemala and Honduras has vastly increased. Those fleeing the region are hoping to escape economic crises, government instability, droughts, and increasingly violent organized crime that has made Central America one of the most dangerous places in the world.

The Trump administration has already tried to skirt international treaties regarding asylum.

One new policy instructed asylum officers to “generally” deny claims pertaining to domestic violence and gang reprisals; other would-be asylees found their claims rejected because they were provided interpreters who didn’t actually speak their language.

The new executive order would be the most hardline attempt to dismantle the asylum process yet, said Jadwat. “It would mean refusing to protect people who can prove they are fleeing persecution… any plan along these lines will be subject to intense legal scrutiny.”

The Southern Poverty Law Center has already filed one lawsuit challenging the administration’s attempts to prevent migrants from beginning the asylum process, arguing that a new policy of turning back asylum seekers who present themselves at ports of entry is a violation of federal and international law, and another suit against this latest executive order appears all but certain.

In the meantime, advocates are looking to Congress to check Trump’s nationalist impulses—if not now, then after the midterm elections have changed the makeup of the Capitol.

“Members of Congress and voters must reject Trump’s attempt to stoke anti-Latinx fears, and reaffirm that like many of our families, these immigrants join the long American tradition of coming here in search of a better life,” said Drake. “They should be welcomed with humanitarian assistance and must be given full and prompt due process, not condemned using absurd war rhetoric.”