The Trump administration discussed using the US military to build facilities to house detained migrants as part of its new mission on the Mexican border but the idea was dropped after the Pentagon expressed doubts about it, US officials said.

The disclosure by US officials, who spoke on condition of anonymity, illustrates the tension within the administration over using military resources to fortify the border against illegal immigration.

Last week, the military announced that over 7,000 troops would go to the border with Mexico as a caravan of Central American migrants slowly heads toward the United States.

The US military declined a draft proposal from the Department of Homeland Security last month to build housing for detained migrants during early discussions in the Trump administration about the military's role on the border, the officials said.

By voicing its opposition, the Pentagon helped ensure that its mission was tailored to only providing support to US government personnel on the border, US officials said.

After initial discussions about the issue, there was no mention of troops building migrant housing facilities when the DHS later made a formal request to the Pentagon for help on the border, the officials said.

Asked about the proposal, the Pentagon declined comment on internal administration deliberations but added that it did not receive a request from DHS to build facilities to house migrant families.

President Donald Trump said last week he plans to build tents to house migrants, who would be held in those facilities while the US government weighs their asylum request.

"We're going to have tents. They're going to be very nice. They're going to wait and if they don't get asylum, they get out," he told Fox News.

General Terrence O'Shaughnessy, the head of US Northern Command, which is overseeing the deployment, told reporters last week that there were no plans at the moment for the US military to build lodging for migrants.

"The requests that we have from the Department of Homeland Security and CBP (Customs and Border Protection) is to build (facilities) to support CBP personnel and our military personnel," he said.

Pentagon spokesman Colonel Robert Manning told reporters more than 4,800 troops were already deployed near the border as of today in support of Operation Faithful Patriot, including 1,100 troops in California, 1,100 in Arizona and 2,600 in Texas.

He anticipated that the number of active duty troops could reach 7,000 soon.

It was unclear how many of those forces had taken up missions on the border, which will include support tasks like building housing for Customs and Border Protection personnel and erecting barriers.

Col Manning said only military police would carry weapons and stressed that there were no plans for US troops to come in contact with protesters or migrants.

He said they would not be taking part in law enforcement activities like crowd control.

One US official cautioned that a previous Trump administration request dating back to spring for US National Guard troops to build facilities for migrants on US bases was still being deliberated.

But, the official noted, that was not expected to be part of Faithful Patriot and the timing of any such future mission was unclear.

Mr Trump's push to send the military to the border comes ahead of tomorrow’s mid-term congressional elections and has triggered sharp reactions, with critics calling it a political stunt that misuses US military resources.

However, Mr Trump's effort has been embraced by Republicans running in the elections, in which illegal immigration is a top issue. The administration says it needs to harden border security as the Central American caravan heads north.