President Donald Trump said U.S. soldiers on the border with Mexico may fire on migrants who commit violence and that people who cross into the country illegally would be detained in "massive" tent cities, as he sought to rev up his base ahead of elections next week.

In a speech at the White House on Thursday, Trump ratcheted up his attacks on the migrants, insisting without evidence that the impoverished families walking toward the U.S. are violent invaders who will endanger Americans' safety if they're allowed into the country.

"They've overrun the Mexican police and they've overrun and hurt, badly, Mexican soldiers," Trump said of migrant "caravans" from Central America. "They want to throw rocks at our military? Our military fights back. I told them, 'Consider it a rifle."'