President Donald Trump is seizing on an attempt by 500 migrants to rush the southern border to use immigration as an issue to bolster his presidency at a critical political moment.

Trump spent weeks ahead of the midterm elections warning that the United States was about to experience an invasion from a migrant caravan trekking north across Mexico, and sent troops to the border in what critics branded a political stunt.

He seized on unrest at the frontier on Sunday to hike pressure on Mexico and to squeeze his political opponents in Washington as he demands financing for his border wall.

“Mexico should move the flag waving Migrants, many of whom are stone cold criminals, back to their countries,” Trump tweeted early Monday morning.

“Do it by plane, do it by bus, do it anyway you want, but they are NOT coming into the U.S.A. We will close the Border permanently if need be. Congress, fund the WALL!”

US authorities said several Border Patrol agents were hit by rocks, prompting the use of tear gas as migrants rushed the border. Border crossings were closed in both directions for several hour.