Under the 1878 federal law members of the army are prohibited from acting as a domestic police force.
Active-duty troops are only allowed to help police officers under limited exceptions to the act, including when expressly authorised by law or by the constitution.
But troops are currently keeping watch over detainees at a facility in Donna, Texas, according to NBC News.
The soldiers reportedly stand watch in a large room where the migrants are held.
The soldiers are unarmed, meant to be present for welfare checks and are not supposed to interact with the detainees, instead referring any issues directly to Border Patrol officers.
But one politician has expressed concern that the soldiers may find themselves in a legal grey area.
John Garamendi, a Democrat who chairs the House Armed Services Committee’s Subcommittee on Readiness, said the situation teetered “on the edge of the Posse Comitatus law.”
“It’s not the role of the US military to be a prison guard,” he said, adding the situation was “certainly mission creep” and could put soldiers “in a precarious legal situation.”
The US military’s Northern Command defended the troops’ presence at the detention centre.
“At the Donna facility specifically unarmed military personnel monitor the migrants for signs of medical distress, possibility for unrest, unusual behaviour and unresponsiveness,” a spokesperson said.
“In the event of a medical emergency or other reportable event, our military personnel immediately notify [Border Patrol] personnel on-site who respond to the incident or event in question.”
“Monitoring the wellness of migrants is not a law enforcement function, and this activity has been reviewed by our legal staff to ensure compliance with the Posse Comitatus Act and applicable law.
“[Border Patrol] personnel are always present to provide force protection, physical security and perform their law enforcement duties.”
The White House sent 2,100 extra troops to the southern border on 18 July, as part of its ongoing efforts to secure the US’ southern border.
As of 8 July, there were about 4,000 service members at the border, the Pentagon said.