By Steve Holland

WASHINGTON (Reuters) - President Donald Trump sharpened his anti-immigration rhetoric on Tuesday, saying he wants to deploy U.S. military forces to the Mexican border to stop illegal immigrants until his long-promised wall is built and "proper security" is in place.

His comments, following a threat to halt foreign aid to Honduras and other countries unless they stopped a "caravan" of Central Americans headed to the United States, immediately raised questions about troop deployment on U.S. soil.

Trump called using the military at the southern border "a big step." He met on Tuesday with U.S. Defense Secretary James Mattis and others to discuss the idea.

"Until we can have a wall and proper security we’re going to be guarding our border with the military," Trump told reporters at the White House, lamenting what he called "horrible" U.S. laws that left the southern border poorly protected.

After 14 months in office, Trump still hammers regularly on an anti-immigration theme that helped to energize conservative Republican voters who helped him win the presidency in the 2016 election. Trump took a hard line on illegal immigration during the campaign and has also sought to curtail legal immigration.

Trump's efforts have failed to produce a deal on immigration or funding a border wall in the Republican-led Congress and no major legislation was expected before November's congressional elections.

Trump gave no details on the size or mission of a military border deployment. The Posse Comitatus Act, a federal law, prohibits using the military for civilian law enforcement duties on U.S. soil unless authorized by Congress.

But the military can provide support services to law enforcement and has done so on occasion since the 1980s.

Under Republican President George W. Bush, National Guard forces were used between 2006 and 2008 for border-related intelligence analysis, but had no direct law enforcement role.

In 2010, President Barack Obama sent some National Guard troops to the U.S.-Mexican border to provide intelligence, surveillance and reconnaissance support to U.S. Border Patrol agents.

Story continues

Some specific statutes authorize the president to deploy troops within the United States for riot control or relief efforts after natural disasters, such as hurricanes and floods.

"The details really matter here," said Stephen Vladeck, a professor at the University of Texas School of Law.

"The real question is going to be if the president is serious about this, what kind of legal arguments do we get out of the White House and the Pentagon for such a deployment."

A senior Republican aide in the U.S. House of Representatives said key lawmakers had not been briefed on the White House plan. The aide said there was no indication that a specific plan had even been formulated yet.

Geronimo Gutierrez, Mexico's ambassador in Washington, said he had spoken to U.S. Homeland Security Secretary Kirstjen Nielsen about Trump's remarks on the border and that Mexico had formally asked the U.S. government to clarify them.

"It's certainly not something that the Mexican government welcomes," Gutierrez told CNN.

At a campaign rally, Mexican leftist Andres Manuel Lopez Obrador, who is leading most opinion polls by double digits before the July 1 presidential election, said that if the U.S. government militarizes the border, thousands of his supporters would protest by forming a "big human chain of Mexicans for peace."

NAFTA, CARAVAN

Trump has railed in recent days against more than 1,200 Central American migrants journeying from the Mexico-Guatemala border toward the United States.

He has also repeated threats to derail the North American Free Trade Agreement (NAFTA) if they are not stopped.

In a Twitter post earlier on Tuesday, Trump said the caravan "heading to our 'Weak Laws' Border, had better be stopped before it gets there. Cash cow NAFTA is in play, as is foreign aid to Honduras and the countries that allow this to happen. Congress MUST ACT NOW!" Congress is on vacation until next week.

Mexican officials intensified efforts to process the dwindling "caravan" and determine whether they had the right to stay in Mexico or sent back to their countries of origin. Such "caravans" of mostly Central Americans, including many escaping violence in Honduras, have occurred annually since 2010 to draw attention to the plight of such migrants.

Trump said he asked Mexico to stop the caravan and he thought Mexican officials were having some success. "As of 12 minutes ago, it was all being broken up," he said.

Some members of Congress said they were uncomfortable with the idea of using the military at the border.

Democratic Senator Brian Schatz said Trump should have to seek approval from Congress for any such troop deployment. "We should put that new law to a vote in the Senate," he said on Twitter. “I predict fewer than 20 votes."

Representative Francis Rooney, a Republican member of the House Foreign Affairs Committee, said there was a risk of increased violence.

"These people should be stopped at the border and vetted out, just the normal process, and we should have plenty of agents down there to do that," Rooney told CNN.

(Reporting by Steve Holland; Additional reporting by Susan Heavey, Makini Brice, Amanda Becker, Richard Cowan and Phil Stewart in Washington; Karen Freifeld in New York and the Mexico City newsroom; Writing by John Whitesides; Editing by Kevin Drawbaugh and Grant McCool)