WASHINGTON (Reuters) - President Donald Trump said on Thursday his administration planned to require immigrants seeking asylum in the United States to come into the country through a legal port of entry, pushing a hard line on immigration ahead of elections next week.

The president’s remarks, five days before U.S. voters determine which party will control Congress and state governorships across the country, drew immediate criticism as an effort to generate fear and energize his political base.

“Migrants seeking asylum will have to present themselves lawfully at a port of entry,” Trump told reporters at the White House, painting a caravan of migrants traveling from Central America toward the United States as a dangerous threat.

“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,” he said.

It was not clear whether the plan would pass legal muster, although Trump, who sought to use immigration as an issue to motivate Republican voters in the 2016 presidential race and now ahead of the Nov. 6 elections, said it would. He added that an executive order was in the process of being finalized, but provided few details.

Federal law provides that any immigrant in the United States may apply for asylum, regardless of whether he or she enters the country through a designated port of entry.

Trump has ramped up his tough stance on illegal immigration in recent days. He deemed the group of migrants from Central America a threat to Americans. It is made up of people who have left poverty and violence at home and are heading slowly through Mexico toward the U.S. border. Trump referred to the movement as an “invasion.”

Slideshow ( 7 images )

Mexico on Wednesday put the size of the caravan that left Honduras in mid-October at 2,800 to 3,000 people. Other caravans have since followed.

The president, who has ordered U.S. troops to the border with Mexico, also suggested rock-throwing by migrants would be treated as equivalent to gun usage.

“They want to throw rocks at our military, our military fights back. We’re going to consider, and I told them to consider it a rifle. When they throw rocks like they did at the Mexico military police, I say: Consider it a rifle,” Trump said.

A Pentagon spokesman, Lieutenant Colonel Jamie Davis, declined to discuss specifics on the military’s potential use of force, but said that U.S. troops “always have the inherent right of self-defense.”

‘ABSURD AS IT IS CRUEL’

Critics said the president was stoking fear ahead of the elections, in which Trump’s Republicans are battling to keep their congressional majorities.

Slideshow ( 7 images )

“President Trump’s attempt to paint peaceful families seeking asylum as a national security threat is as absurd as it is cruel,” said advocacy group Human Rights First in a statement. “The president is fear mongering to score political points ahead of a contentious election at the expense of people’s lives.”

The American Civil Liberties Union said: “If he plans at some point to prohibit people from applying for asylum between the ports of entry, that plan is illegal.”

Republican Senator Chuck Grassley, an ally of the president and head of the powerful Senate Judiciary Committee, said in a letter to the secretaries of the Department of Homeland Security and the State Department that his office had received information that several members of the caravan had “significant criminal histories.”

Trump said on Wednesday the United States could send as many as 15,000 troops to the border to confront the migrant caravan, more than twice the number previously disclosed by defense officials.

A U.S. defense official said about 100 active-duty troops arrived on the border at McAllen, Texas, on Thursday.

Republican lawmakers and other Trump supporters have applauded the deployment. But critics argue Trump has manufactured a crisis for the U.S. military to address.

Trump also said this week he would seek to scrap the constitutional right of citizenship for U.S.-born children of noncitizens and illegal immigrants. Such an action would face a likely legal challenge.