The Trump administration announced a plan Thursday to dramatically cut back immigrants' ability to request asylum in the USA, a direct challenge to federal law and international conventions that the president said is necessary to stop an immigrant caravan slowly making its way to the U.S.-Mexican border.

Immigrants are allowed to request asylum whether they present themselves at ports of entry or sidestep those ports and illegally enter the country. The rules proposed by the administration would bar those who enter illegally from making an asylum claim and place them into expedited deportation proceedings instead, according to a posting by the Departments of Justice and Homeland Security on the Federal Register late Thursday.

President Donald Trump hinted at such a change in the weeks leading up to Tuesday's midterm elections as part of a broader strategy in which he focused almost exclusively on immigration in an effort to rile up the GOP base. During a news conference four days before the midterm elections, he said there was "rampant abuse" of the nation's asylum system, which saw an increase in claims from 5,000 in 2008 to 97,000 in 2018, mostly fueled by Central Americans fleeing violence and poverty in their home countries.

“Our asylum system is overwhelmed with too many meritless asylum claims from aliens who place a tremendous burden on our resources, preventing us from being able to expeditiously grant asylum to those who truly deserve it,” Department of Homeland Security Secretary Kirstjen Nielsen and Acting Attorney General Matthew Whitaker said in a joint statement. “Today, we are using the authority granted to us by Congress to bar aliens who violate (the new rules).”

Lee Gelernt, an American Civil Liberties Union attorney who led the lawsuit that forced the Trump administration to reunite more than 2,500 immigrant children separated from their parents this summer, said the proposed asylum changes are dubious.

“The administration’s plan to categorically deny asylum to those who enter between ports of entry is patently unlawful and inconsistent with our nation’s commitment to providing a safe haven to those in danger,” Gelernt said Thursday. “There will be lawsuits.”

Several groups have already filed lawsuits in California and the District of Columbia challenging the administration’s actions to limit asylum. Thursday’s announcement will add to the litigation, which could be decided by a Supreme Court that includes two Trump appointees.

Asylum is a form of protection granted to people who fear persecution in their home countries based on their race, religion, nationality, membership in a particular social group or their political opinion. From 2000 to 2016, the United States granted asylum to an average of 26,651 foreigners a year, according to Department of Homeland Security data.

The 1965 Immigration and Nationality Act states that any foreigner who arrives in the USA, "whether or not at a designated port of arrival," may apply for asylum. A United Nations treaty signed in 1951 by the United States says "refugees should not be penalized for their illegal entry" because extreme situations sometimes "require refugees to breach immigration rules."

To override those rules, the administration used a rationale similar to its argument for its controversial travel ban targeting majority-Muslim countries. U.S. law allows a president to sign a proclamation suspending entry to people who are deemed "detrimental to the interests of the United States." Trump is likely to sign a presidential proclamation as early as Friday outlining the asylum restrictions, which would kick-start the new rules.

As the number of immigrants requesting asylum along the southern border increased in recent years, thousands have had to wait on the Mexican side of the border, sometimes sleeping on bridges and streets, to plead their case. The Mexican government, working with nongovernmental organizations and volunteer groups, created a system by which applicants are signed up and allowed to enter U.S. ports of entry in order.

Those long waits, after even longer journeys to reach the U.S. border, often drive immigrants to enter the country illegally and request asylum that way. When the last caravan reached the USA in April, 401 presented themselves at ports of entry, as the administration has urged them to do, but 122 quit waiting and entered the country illegally to request asylum, according to data from U.S. Citizenship and Immigration Services.

Thursday's announcement follows several other steps taken by the administration to halt the caravan, which Trump described as an "invasion" of the country.

The Pentagon mobilized more than 7,000 active-duty military troops, who started laying miles of concertina wire along portions of the border. U.S. Customs and Border Protection repositioned its agents from throughout the country to line the southern border to prevent illegal entries.

During a trip to the border, CBP Commissioner Kevin McAleenan said he viewed the oncoming caravan as a "law enforcement situation" and his officers could not speed up the process to interview asylum seekers.

Thousands of migrants have been in Mexico City, where they have regrouped and are demanding buses to take them to the U.S.-Mexico border. Mexico City government authorities told The Associated Press that nearly 5,000 migrants are being sheltered in a sports complex, with more than 1,700 migrants under the age of 18, including 310 children under age five.

The Mexican government told the AP that most of the migrants have refused offers to stay in Mexico, and only a small number have agreed to return to their home countries. About 85 percent of the migrants are from Honduras, while others are from the Central American countries of Guatemala, El Salvador and Nicaragua.

Contributing: John Fritze in Washington.